File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
metadata/com.mysql/mysql-connector-j/8.0.31
tests/src/com.mysql/mysql-connector-j/8.0.31/src/test/java/mysql Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 118118 "allPublicConstructors" : true ,
119119 "name" : " com.mysql.cj.exceptions.InvalidConnectionAttributeException"
120120 },
121+ {
122+ "condition" : {
123+ "typeReachable" : " com.mysql.cj.jdbc.ConnectionImpl"
124+ },
125+ "allPublicConstructors" : true ,
126+ "name" : " com.mysql.cj.PerConnectionLRUFactory"
127+ },
121128 {
122129 "condition" : {
123130 "typeReachable" : " com.mysql.cj.protocol.ExportControlled"
Original file line number Diff line number Diff line change 2020import java .sql .ResultSet ;
2121import java .sql .SQLException ;
2222import java .time .Duration ;
23+ import java .util .Collections ;
24+ import java .util .Map ;
2325import java .util .Properties ;
2426
2527import static org .assertj .core .api .Assertions .assertThat ;
28+ import static org .assertj .core .api .Assertions .assertThatNoException ;
2629
2730/**
2831 * This test uses docker to start a MySQL database to test against.
@@ -40,9 +43,14 @@ public class MySQLTests {
4043 private static Process process ;
4144
4245 private static Connection openConnection () throws SQLException {
46+ return openConnection (Collections .emptyMap ());
47+ }
48+
49+ private static Connection openConnection (Map <String , String > additionalProperties ) throws SQLException {
4350 Properties props = new Properties ();
4451 props .setProperty ("user" , USERNAME );
4552 props .setProperty ("password" , PASSWORD );
53+ props .putAll (additionalProperties );
4654 return DriverManager .getConnection (JDBC_URL , props );
4755 }
4856
@@ -139,4 +147,10 @@ void simpleDatatypes() throws Exception {
139147 }
140148 }
141149 }
150+
151+ @ Test
152+ void preparedStatementCaching () {
153+ assertThatNoException ().isThrownBy (() -> openConnection (Map .of ("cachePrepStmts" , "true" )).close ());
154+ }
155+
142156}
You can’t perform that action at this time.
0 commit comments