Commit Graph

292 Commits

Author SHA1 Message Date
Juergen Hoeller
f3d0beb955 AbstractDriverBasedDataSource does not rely on Properties chaining anymore
Issue: SPR-9461
2013-01-18 19:07:46 +01:00
Juergen Hoeller
cd8d72e3f8 AbstractDriverBasedDataSource does not rely on Properties chaining anymore
Issue: SPR-9461
2013-01-18 14:02:40 +01:00
Juergen Hoeller
f449b5a5b3 JDBC parameter binding uses JDBC 3.0 ParameterMetaData (if available) for type determination
In sync with 3.2.1 now, containing minor modifications for defensiveness against the JDBC driver.

Issue: SPR-10084
2013-01-11 21:57:55 +01:00
Juergen Hoeller
eb24365556 ResourceDatabasePopulator explicitly closes its LineNumberReader
Issue: SPR-9960
Backport-Issue: SPR-9912
2012-12-12 12:15:20 +01:00
Juergen Hoeller
f4532ad704 Avoid a hard dependency on Sun's CachedRowSetImpl class 2012-11-25 22:21:01 +01:00
Spring Buildmaster
e0b29b708c Increment version to 3.1.4.BUILD-SNAPSHOT 2012-10-31 18:14:06 +01:00
Spring Buildmaster
6c36240055 Release version 3.1.3.RELEASE 2012-10-31 18:12:45 +01:00
Sam Brannen
d8dc4a257a Support comments in SQL scripts in JdbcTestUtils
Prior to this commit, utility methods in JdbcTestUtils interpreted SQL
comments as separate statements, resulting in an exception when such a
script is executed.

This commit addresses this issue by introducing a
readScript(lineNumberReader, String) method that accepts a comment
prefix. Comment lines are therefore no longer returned in the parsed
script. Furthermore, the existing readScript(lineNumberReader) method
now delegates to this new readScript() method, supplying "--" as the
default comment prefix.

Issue: SPR-9593
Backport-Commit: 4aaf014cc6
2012-10-26 10:45:56 +02:00
Chris Beams
00ed17dca0 Update Apache license header date
Issue: SPR-9853
Backport-Commit: 8a38891e15
2012-10-25 09:24:36 +02:00
Phillip Webb
a0745c0c0a Support SQL exception translation for ORA-06550
Oracle error ORA-06550 will now raise a BadSqlGrammarException.

Issue: SPR-9853
Backport-Commit: ba5a148d8d
2012-10-24 10:46:06 -07:00
Phillip Webb
cfdd50d8ab Polish whitespace 2012-10-24 10:45:29 -07:00
Juergen Hoeller
86ef22db49 Backported "Work around JDK7 String#substring performance regression"
Issue: SPR-9781
Issue: SPR-9784
2012-10-10 23:33:51 +02:00
Juergen Hoeller
da8e2d6736 AbstractRoutingDataSource consistently implements JDBC 4.0's Wrapper interface as well
Issue: SPR-9856
2012-10-10 14:28:15 +02:00
Juergen Hoeller
43bc3f19d9 Spring-backed DataSources consistently implement JDBC 4.0's Wrapper interface
Issue: SPR-9770
2012-09-10 10:41:11 +02:00
Juergen Hoeller
5204e11d9c Backported recent "cannotAcquireLockCodes" additions
Issue: SPR-9141
Issue: SPR-9681
2012-08-28 18:56:20 +02:00
Spring Buildmaster
671f97721f Increment version to 3.1.3.BUILD-SNAPSHOT 2012-07-07 20:05:06 +02:00
Spring Buildmaster
49f728eae8 Release version 3.1.2.RELEASE 2012-07-07 17:13:55 +02:00
Oliver Gierke
0769d53a6a Use transactional connection during db population
Previously, DatabasePopulatorUtils#execute looked up a Connection from
the given DataSource directly which resulted in the executed statements
not being executed against a transactional connection (if any) which in
turn resulted in the statements executed by the populator potentially
not being rolled back.

Now DataSourceUtils#getConnection is used to transparently take part in
any active transaction and #releaseConnection is used to ensure the
connection is closed if appropriate.

Issue: SPR-9465
Backport-Issue: SPR-9457
Backport-Commit: 49c9a2a915
2012-06-27 23:06:04 +02:00
Juergen Hoeller
ee9b9d6a57 JDBC parameter binding uses JDBC 3.0 ParameterMetaData (if available) for type determination 2012-03-14 16:54:22 +01:00
Juergen Hoeller
79d9f7a5f7 JDBC parameter binding uses JDBC 3.0 ParameterMetaData (if available) for type determination 2012-03-14 16:07:39 +01:00
Spring Buildmaster
b32a365f14 Increment version to 3.1.2.BUILD-SNAPSHOT 2012-02-16 15:38:16 -08:00
Spring Buildmaster
79c9ca1a26 Release version 3.1.1.RELEASE 2012-02-16 15:33:27 -08:00
Juergen Hoeller
ddf0d071ad revised CustomSQLExceptionTranslatorRegistry/Registrar method naming 2012-02-14 21:29:22 +01:00
jhoeller
caa50a1d41 Merge pull request #33 from trisberg/SQLException-translation-enhancements
SQL exception translation enhancements
2012-02-12 07:19:21 -08:00
jhoeller
6e00456e67 Merge pull request #25 from trisberg/fixes-for-SimpleJdbcInsert
Fixes for SimpleJdbcInsert [SPR-9006]
2012-02-12 07:17:15 -08:00
Juergen Hoeller
1e1f8c912b substituteNamedParameters detects and unwraps SqlParameterValue objects (SPR-9052) 2012-02-11 19:15:35 +01:00
Thomas Risberg
66012b951e Adding null check for username being null.
The username is usually not null, but it  could be for some embedded databases.

Always setting generatedKeysColumnNameArraySupported to false when getGeneratedKeysSupported is false, since it can't be supported without having generated keys supported. This change only affects logging messages.

Issue: SPR-9006
2012-02-09 17:55:04 -05:00
Thomas Risberg
f6c7d99ba4 Improvements for registering custom SQL exception translators in app contexts.
Adding a static CustomSQLExceptionTranslatorRegistry and a CustomSQLExceptionTranslatorRegistrar that can be used to register custom SQLExceptionTranslator implementations for specific databases from any application context.

This can be used in application contexts like this:

  <bean class="org.springframework.jdbc.support.CustomSQLExceptionTranslatorRegistrar">
    <property name="sqlExceptionTranslators">
      <map>
        <entry key="H2">
          <bean class="com.yourcompany.data.CustomSqlExceptionTranslator"/>
        </entry>
      </map>
    </property>
  </bean>

Issue: SPR-7675
2012-02-09 17:43:05 -05:00
Thomas Risberg
9fb6e2313c Fix single quote parsing in NamedParameterUtils
Prior to this change, single quotes were incorrectly parsed by
NamedParameterUtils#parseSqlStatement, resulting in incorrect parameter
counts:

    ParsedSql sql = NamedParameterUtils
            .parseSqlStatement("SELECT 'foo''bar', :xxx FROM DUAL");
    assert sql.getTotalParameterCount() == 0 // incorrect, misses :xxx

That is, presence of the single-quoted string caused the parser to
overlook the named parameter :xxx.

This commit fixes the parsing error such that:

    ParsedSql sql = NamedParameterUtils
            .parseSqlStatement("SELECT 'foo''bar', :xxx FROM DUAL");
    assert sql.getTotalParameterCount() == 1 // correct

Issue: SPR-8280
2012-02-06 09:47:17 +01:00
Thomas Risberg
2ffa4725cd Allow SELECT statements in ResourceDatabasePopulator
ResourceDatabasePopulator is a component that underlies the database
initialization support within Spring's jdbc: namespace, e.g.:

    <jdbc:initialize-database data-source="dataSource">
        <jdbc:script execution="INIT" location="classpath:init.sql"/>
    </jdbc:initialize-database>

Prior to this commit, ResourceDatabasePopulator#executeSqlScript's use
of Statement#executeUpdate(sql) precluded the possibility of SELECT
statements because returning a result is not permitted by this method
and results in an exception being thrown.

Whether this behavior is a function of the JDBC specification or an
idiosyncracy of certain implementations does not matter as the issue
can be worked around entirely. This commit eliminates use
of #executeUpdate(sql) in favor of #execute(sql) followed by a call
to #getUpdateCount, effectively allowing any kind of SQL statement to
be executed during database initialization.

Issue: SPR-8932
2012-02-06 08:59:28 +01:00
Chris Beams
87a021d5c9 Add <license> section to 3.1.x Maven poms
Issue: SPR-8927
2012-01-31 15:18:05 +01:00
Juergen Hoeller
adac38f91b fixed documented bean class names in jdbc namespace xsd (SPR-8972) 2012-01-05 17:38:01 +01:00
Juergen Hoeller
211f8ea854 JBossNativeJdbcExtractor is compatible with JBoss AS 7 as well (SPR-8957) 2012-01-05 17:37:59 +01:00
Chris Beams
41c405998e Convert CRLF=>LF on files missed earlier
Complete pass with `dos2unix` found additional files missed on earlier
related commit.

Issue: SPR-5608
2011-12-22 14:06:44 +01:00
Chris Beams
88913f2b23 Convert CRLF (dos) to LF (unix)
Prior to this change, roughly 5% (~300 out of 6000+) of files under the
source tree had CRLF line endings as opposed to the majority which have
LF endings.

This change normalizes these files to LF for consistency going forward.

Command used:

$ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix

Issue: SPR-5608
2011-12-21 14:52:47 +01:00
Chris Beams
e158f61e93 Increment version to 3.1.1.BUILD-SNAPSHOT 2011-12-16 11:59:06 +01:00
Chris Beams
ac107d0c2a Release Spring Framework 3.1.0.RELEASE 2011-12-13 16:35:49 +00:00
Juergen Hoeller
1141a1d610 polishing 2011-12-11 23:07:07 +00:00
Chris Beams
70c28a0bc5 Add Apache license header where missing in src/main 2011-11-16 18:23:56 +00:00
Chris Beams
7b491370a3 Polish EmbeddedDatabaseBuilder
Minor improvements made during the triage of SPR-8817
2011-11-13 01:38:47 +00:00
Juergen Hoeller
b21e1ee669 polishing 2011-11-11 09:57:34 +00:00
Thomas Risberg
dee9e280b0 SPR-7476 Improving named parameter parsing skipping escaped colons like '\:' and allowing for delimiting parameter names with curly brackets like :{p1} 2011-10-08 12:48:26 +00:00
Thomas Risberg
933e22320d SPR-7476 Improving named parameter parsing skipping escaped colons like '\:' and allowing for delimiting parameter names with curly brackets like :{p1} 2011-10-08 12:10:56 +00:00
Thomas Risberg
4f5248bb5c SPR-7476 Improving named parameter parsing skipping escaped colons like '\:' and allowing for delimiting parameter names with curly brackets like :{p1} 2011-10-08 11:48:45 +00:00
Thomas Risberg
aec82fbd4a SPR-7476 Improving named parameter parsing skipping escaped colons like '\:' and allowing for delimiting parameter names with curly brackets like :{p1} 2011-10-07 18:57:32 +00:00
Thomas Risberg
92d6e5a14c SPR-8270 Adding improved support for detecting current schema name for Oracle 2011-10-07 03:01:43 +00:00
Thomas Risberg
118ee3fce8 SPR-8652 Fixing queryForLong and queryForInt implementation to use correct expected type 2011-10-06 23:58:38 +00:00
Thomas Risberg
0920f2d7d5 SPR-8235 SPR-7480 Updating H2 error codes 2011-10-06 23:19:05 +00:00
Chris Beams
4e522c0cc3 Fix Javadoc error in JdbcOperations
Issue: SPR-8664
2011-09-03 20:07:08 +00:00
Sam Brannen
1de71c6e37 [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00