Support SQL exception translation for ORA-06550

Oracle error ORA-06550 will now raise a BadSqlGrammarException.

Issue: SPR-9853
This commit is contained in:
Phillip Webb 2012-10-24 10:39:11 -07:00
parent ba5a148d8d
commit 91f6123167
2 changed files with 3 additions and 2 deletions

View File

@ -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>

View File

@ -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);
}