File tree 3 files changed +28
-2
lines changed
main/java/org/tarantool/jdbc
test/java/org/tarantool/jdbc
3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -479,13 +479,13 @@ private void throwUnknownClientProperties(Collection<Object> properties) throws
479
479
@ Override
480
480
public String getClientInfo (String name ) throws SQLException {
481
481
checkNotClosed ();
482
- throw new SQLFeatureNotSupportedException () ;
482
+ return null ;
483
483
}
484
484
485
485
@ Override
486
486
public Properties getClientInfo () throws SQLException {
487
487
checkNotClosed ();
488
- throw new SQLFeatureNotSupportedException ();
488
+ return new Properties ();
489
489
}
490
490
491
491
@ Override
Original file line number Diff line number Diff line change 17
17
import org .junit .jupiter .api .Test ;
18
18
import org .junit .jupiter .api .function .Executable ;
19
19
20
+ import java .sql .ClientInfoStatus ;
20
21
import java .sql .Connection ;
21
22
import java .sql .DatabaseMetaData ;
22
23
import java .sql .DriverManager ;
23
24
import java .sql .PreparedStatement ;
24
25
import java .sql .ResultSet ;
26
+ import java .sql .SQLClientInfoException ;
25
27
import java .sql .SQLException ;
26
28
import java .sql .SQLFeatureNotSupportedException ;
27
29
import java .sql .Statement ;
30
+ import java .util .Map ;
28
31
29
32
public class JdbcConnectionIT {
30
33
@@ -443,4 +446,19 @@ public void testGeneratedKeys() throws SQLException {
443
446
);
444
447
}
445
448
449
+ @ Test
450
+ void testSetClientInfoProperties () {
451
+ String targetProperty = "ApplicationName" ;
452
+
453
+ SQLClientInfoException exception = assertThrows (
454
+ SQLClientInfoException .class ,
455
+ () -> conn .setClientInfo (targetProperty , "TestApp" )
456
+ );
457
+
458
+ Map <String , ClientInfoStatus > failedProperties = exception .getFailedProperties ();
459
+ assertEquals (1 , failedProperties .size ());
460
+ assertEquals (ClientInfoStatus .REASON_UNKNOWN_PROPERTY , failedProperties .get (targetProperty ));
461
+ }
462
+
446
463
}
464
+
Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ public void tearDownTest() throws SQLException {
75
75
testHelper .executeSql (CLEAN_SQL );
76
76
}
77
77
78
+ @ Test
79
+ public void testGetSupportedClientInfo () throws SQLException {
80
+ ResultSet rs = meta .getClientInfoProperties ();
81
+ assertNotNull (rs );
82
+ assertFalse (rs .next ());
83
+ rs .close ();
84
+ }
85
+
78
86
@ Test
79
87
public void testGetTableTypes () throws SQLException {
80
88
ResultSet rs = meta .getTableTypes ();
You can’t perform that action at this time.
0 commit comments