Skip to content

Commit a0745c0

Browse files
committed
Support SQL exception translation for ORA-06550
Oracle error ORA-06550 will now raise a BadSqlGrammarException. Issue: SPR-9853 Backport-Commit: ba5a148
1 parent cfdd50d commit a0745c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166

167167
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
168168
<property name="badSqlGrammarCodes">
169-
<value>900,903,904,917,936,942,17006</value>
169+
<value>900,903,904,917,936,942,17006,6550</value>
170170
</property>
171171
<property name="invalidResultSetAccessCodes">
172172
<value>17003</value>

org.springframework.jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ public void testDefaultInstanceWithOracle() {
5757
private void assertIsOracle(SQLErrorCodes sec) {
5858
assertTrue(sec.getBadSqlGrammarCodes().length > 0);
5959
assertTrue(sec.getDataIntegrityViolationCodes().length > 0);
60-
// This had better be a Bad SQL Grammar code
60+
// These had better be a Bad SQL Grammar code
6161
assertTrue(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "942") >= 0);
62+
assertTrue(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "6550") >= 0);
6263
// This had better NOT be
6364
assertFalse(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "9xx42") >= 0);
6465
}

0 commit comments

Comments
 (0)