File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/main/java/picoded/dstack/connector/jsql Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -218,8 +218,22 @@ public static HikariDataSource mysql(GenericConvertMap config) {
218218
219219 // Setup the configured connection URL + DB
220220 // hconfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
221+
222+ String jdbcUrl = "jdbc:mysql://" + host + ":" + port + "/" + name ;
223+
224+ // add jdbc params, if any, e.g.:
225+ // [
226+ // "useSSL=REQUIRED",
227+ // "enabledTLSProtocols=TLSv1.2,TLSv1.3",
228+ // ]
229+ String [] params = config .getStringArray ("params" , "[]" );
230+ if (params != null && params .length > 0 ) {
231+ for (int i = 0 ; i < params .length ; i ++) {
232+ jdbcUrl += (i == 0 ? "?" : "&" ) + params [i ];
233+ }
234+ }
221235
222- hconfig .setJdbcUrl ("jdbc:mysql://" + host + ":" + port + "/" + name );
236+ hconfig .setJdbcUrl (jdbcUrl );
223237
224238 // Setup the username and password
225239 hconfig .setUsername (user );
You can’t perform that action at this time.
0 commit comments