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 118
118
"allPublicConstructors" : true ,
119
119
"name" : " com.mysql.cj.exceptions.InvalidConnectionAttributeException"
120
120
},
121
+ {
122
+ "condition" : {
123
+ "typeReachable" : " com.mysql.cj.jdbc.ConnectionImpl"
124
+ },
125
+ "allPublicConstructors" : true ,
126
+ "name" : " com.mysql.cj.PerConnectionLRUFactory"
127
+ },
121
128
{
122
129
"condition" : {
123
130
"typeReachable" : " com.mysql.cj.protocol.ExportControlled"
Original file line number Diff line number Diff line change 20
20
import java .sql .ResultSet ;
21
21
import java .sql .SQLException ;
22
22
import java .time .Duration ;
23
+ import java .util .Collections ;
24
+ import java .util .Map ;
23
25
import java .util .Properties ;
24
26
25
27
import static org .assertj .core .api .Assertions .assertThat ;
28
+ import static org .assertj .core .api .Assertions .assertThatNoException ;
26
29
27
30
/**
28
31
* This test uses docker to start a MySQL database to test against.
@@ -40,9 +43,14 @@ public class MySQLTests {
40
43
private static Process process ;
41
44
42
45
private static Connection openConnection () throws SQLException {
46
+ return openConnection (Collections .emptyMap ());
47
+ }
48
+
49
+ private static Connection openConnection (Map <String , String > additionalProperties ) throws SQLException {
43
50
Properties props = new Properties ();
44
51
props .setProperty ("user" , USERNAME );
45
52
props .setProperty ("password" , PASSWORD );
53
+ props .putAll (additionalProperties );
46
54
return DriverManager .getConnection (JDBC_URL , props );
47
55
}
48
56
@@ -139,4 +147,10 @@ void simpleDatatypes() throws Exception {
139
147
}
140
148
}
141
149
}
150
+
151
+ @ Test
152
+ void preparedStatementCaching () {
153
+ assertThatNoException ().isThrownBy (() -> openConnection (Map .of ("cachePrepStmts" , "true" )).close ());
154
+ }
155
+
142
156
}
You can’t perform that action at this time.
0 commit comments