2023年5月18日12:26:54
parent
99439aaf68
commit
db2423961a
|
|
@ -104,7 +104,7 @@ public class SqlQueryController {
|
|||
|
||||
String sql = query_area.getSelectedText();
|
||||
|
||||
if (is_exchange.get()){
|
||||
if (is_exchange.get()) {
|
||||
connection();
|
||||
}
|
||||
|
||||
|
|
@ -122,11 +122,11 @@ public class SqlQueryController {
|
|||
for (Map.Entry<String, Object> entry : map1.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
|
||||
if (key.equals("unique_identification_key")){
|
||||
if (key.equals("unique_identification_key")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key.equals("now_pos")){//now_pos -> null
|
||||
if (key.equals("now_pos")) {//now_pos -> null
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -151,20 +151,15 @@ public class SqlQueryController {
|
|||
|
||||
|
||||
public void getJdbcTemplate() {
|
||||
|
||||
if (jdbcTemplate == null) {
|
||||
jdbcTemplate = new JdbcTemplate();
|
||||
|
||||
DruidDataSource datasource = new DruidDataSource();
|
||||
String url = "jdbc:mysql://" + ip.getText() + ":" + port.getText() + "/" + database.getText() + "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true";
|
||||
String driverClassName = "com.mysql.jdbc.Driver";
|
||||
datasource.setUrl(url);
|
||||
datasource.setUsername(username.getText());
|
||||
datasource.setPassword(password.getText());
|
||||
datasource.setDriverClassName(driverClassName);
|
||||
|
||||
jdbcTemplate.setDataSource(datasource);
|
||||
}
|
||||
jdbcTemplate = new JdbcTemplate();
|
||||
DruidDataSource datasource = new DruidDataSource();
|
||||
String url = "jdbc:mysql://" + ip.getText() + ":" + port.getText() + "/" + database.getText() + "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true";
|
||||
String driverClassName = "com.mysql.jdbc.Driver";
|
||||
datasource.setUrl(url);
|
||||
datasource.setUsername(username.getText());
|
||||
datasource.setPassword(password.getText());
|
||||
datasource.setDriverClassName(driverClassName);
|
||||
jdbcTemplate.setDataSource(datasource);
|
||||
}
|
||||
|
||||
public void connection() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue