File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
main/java/org/tarantool/jdbc
test/java/org/tarantool/jdbc Expand file tree Collapse file tree 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
479479 @ Override
480480 public String getClientInfo (String name ) throws SQLException {
481481 checkNotClosed ();
482- throw new SQLFeatureNotSupportedException () ;
482+ return null ;
483483 }
484484
485485 @ Override
486486 public Properties getClientInfo () throws SQLException {
487487 checkNotClosed ();
488- throw new SQLFeatureNotSupportedException ();
488+ return new Properties ();
489489 }
490490
491491 @ Override
Original file line number Diff line number Diff line change 1717import org .junit .jupiter .api .Test ;
1818import org .junit .jupiter .api .function .Executable ;
1919
20+ import java .sql .ClientInfoStatus ;
2021import java .sql .Connection ;
2122import java .sql .DatabaseMetaData ;
2223import java .sql .DriverManager ;
2324import java .sql .PreparedStatement ;
2425import java .sql .ResultSet ;
26+ import java .sql .SQLClientInfoException ;
2527import java .sql .SQLException ;
2628import java .sql .SQLFeatureNotSupportedException ;
2729import java .sql .Statement ;
30+ import java .util .Map ;
2831
2932public class JdbcConnectionIT {
3033
@@ -443,4 +446,19 @@ public void testGeneratedKeys() throws SQLException {
443446 );
444447 }
445448
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+
446463}
464+
Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ public void tearDownTest() throws SQLException {
7575 testHelper .executeSql (CLEAN_SQL );
7676 }
7777
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+
7886 @ Test
7987 public void testGetTableTypes () throws SQLException {
8088 ResultSet rs = meta .getTableTypes ();
You can’t perform that action at this time.
0 commit comments