9
9
import org .tarantool .CommunicationException ;
10
10
import org .tarantool .JDBCBridge ;
11
11
import org .tarantool .TarantoolConnection ;
12
+ import org .tarantool .util .JdbcConstants ;
12
13
import org .tarantool .util .SQLStates ;
13
14
14
15
import java .io .IOException ;
40
41
import java .util .Properties ;
41
42
import java .util .concurrent .Executor ;
42
43
43
- @ SuppressWarnings ("Since15" )
44
44
public class SQLConnection implements Connection {
45
45
46
46
private static final int UNSET_HOLDABILITY = 0 ;
@@ -593,10 +593,7 @@ private void handleException(Exception e) {
593
593
* @throws SQLNonTransientException param has invalid value
594
594
*/
595
595
private void checkHoldabilitySupport (int holdability ) throws SQLException {
596
- if (holdability != ResultSet .CLOSE_CURSORS_AT_COMMIT &&
597
- holdability != ResultSet .HOLD_CURSORS_OVER_COMMIT ) {
598
- throw new SQLNonTransientException ("" , SQLStates .INVALID_PARAMETER_VALUE .getSqlState ());
599
- }
596
+ JdbcConstants .checkHoldabilityConstant (holdability );
600
597
if (!getMetaData ().supportsResultSetHoldability (holdability )) {
601
598
throw new SQLFeatureNotSupportedException ();
602
599
}
@@ -613,4 +610,5 @@ private void checkHoldabilitySupport(int holdability) throws SQLException {
613
610
private static String formatError (String sql , Object ... params ) {
614
611
return "Failed to execute SQL: " + sql + ", params: " + Arrays .deepToString (params );
615
612
}
613
+
616
614
}
0 commit comments