Browse Source

Support SQL exception translation for ORA-06550

Oracle error ORA-06550 will now raise a BadSqlGrammarException.

Issue: SPR-9853
pull/127/merge
Phillip Webb 12 years ago
parent
commit
91f6123167
  1. 2
      spring-jdbc/src/main/resources/org/springframework/jdbc/support/sql-error-codes.xml
  2. 3
      spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java

2
spring-jdbc/src/main/resources/org/springframework/jdbc/support/sql-error-codes.xml

@ -166,7 +166,7 @@ @@ -166,7 +166,7 @@
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="badSqlGrammarCodes">
<value>900,903,904,917,936,942,17006</value>
<value>900,903,904,917,936,942,17006,6550</value>
</property>
<property name="invalidResultSetAccessCodes">
<value>17003</value>

3
spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java

@ -57,8 +57,9 @@ public class SQLErrorCodesFactoryTests extends TestCase { @@ -57,8 +57,9 @@ public class SQLErrorCodesFactoryTests extends TestCase {
private void assertIsOracle(SQLErrorCodes sec) {
assertTrue(sec.getBadSqlGrammarCodes().length > 0);
assertTrue(sec.getDataIntegrityViolationCodes().length > 0);
// This had better be a Bad SQL Grammar code
// These had better be a Bad SQL Grammar code
assertTrue(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "942") >= 0);
assertTrue(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "6550") >= 0);
// This had better NOT be
assertFalse(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "9xx42") >= 0);
}

Loading…
Cancel
Save