2023年5月18日12:26:54

master
zhangmeng 2023-05-18 12:26:59 +08:00
parent 99439aaf68
commit db2423961a
1 changed files with 12 additions and 17 deletions

View File

@ -104,7 +104,7 @@ public class SqlQueryController {
String sql = query_area.getSelectedText(); String sql = query_area.getSelectedText();
if (is_exchange.get()){ if (is_exchange.get()) {
connection(); connection();
} }
@ -122,11 +122,11 @@ public class SqlQueryController {
for (Map.Entry<String, Object> entry : map1.entrySet()) { for (Map.Entry<String, Object> entry : map1.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
if (key.equals("unique_identification_key")){ if (key.equals("unique_identification_key")) {
continue; continue;
} }
if (key.equals("now_pos")){//now_pos -> null if (key.equals("now_pos")) {//now_pos -> null
continue; continue;
} }
@ -151,10 +151,7 @@ public class SqlQueryController {
public void getJdbcTemplate() { public void getJdbcTemplate() {
if (jdbcTemplate == null) {
jdbcTemplate = new JdbcTemplate(); jdbcTemplate = new JdbcTemplate();
DruidDataSource datasource = new DruidDataSource(); 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 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"; String driverClassName = "com.mysql.jdbc.Driver";
@ -162,10 +159,8 @@ public class SqlQueryController {
datasource.setUsername(username.getText()); datasource.setUsername(username.getText());
datasource.setPassword(password.getText()); datasource.setPassword(password.getText());
datasource.setDriverClassName(driverClassName); datasource.setDriverClassName(driverClassName);
jdbcTemplate.setDataSource(datasource); jdbcTemplate.setDataSource(datasource);
} }
}
public void connection() { public void connection() {