mysql change

oracle
修改密码漏洞修复完成 11 months ago
parent 73831a1d80
commit 1aafa8e477

1
.gitignore vendored

@ -4,6 +4,7 @@ target/
/target/* /target/*
/.idea/* /.idea/*
/.idea /.idea
.idea/*
.idea .idea
.idea/ .idea/
pom.xml.tag pom.xml.tag

@ -68,13 +68,19 @@ public class JdbcDemoController {
public static DataSource ds = new DataSource(); public static DataSource ds = new DataSource();
static { static {
//配置数据源 //配置数据源
ds.setId("1"); // ds.setId("1");
ds.setName("mysql"); // ds.setName("mysql");
//ds.setUrl("jdbc:mysql://192.168.3.7:3306/appserver?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8"); // ds.setUrl("jdbc:mysql://192.168.3.7:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true");
ds.setUrl("jdbc:mysql://192.168.3.7:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true"); // ds.setUsername("root");
ds.setUsername("root"); // ds.setPassword("Skyinno251,");
ds.setPassword("Skyinno251,"); // ds.setDriver("com.mysql.cj.jdbc.Driver");
ds.setDriver("com.mysql.cj.jdbc.Driver");
ds.setId("2");
ds.setName("oracle");
ds.setUrl("jdbc:oracle:thin:@192.168.3.7:1521/orcl");
ds.setUsername("appserver");
ds.setPassword("appserver");
ds.setDriver("oracle.jdbc.driver.OracleDriver");
} }
/** /**
@ -87,12 +93,12 @@ public class JdbcDemoController {
String sql = "select * from temperature where id = ?"; String sql = "select * from temperature where id = ?";
List<Object> jdbcParamValues = new ArrayList<>(); List<Object> jdbcParamValues = new ArrayList<>();
for(int i=1230883;i<1646758;i++){ for(int i=1659797;i<1669689;i++){
try { // try {
Thread.sleep(10); // Thread.sleep(5);
} catch (InterruptedException e) { // } catch (InterruptedException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
jdbcParamValues.add(i+1); jdbcParamValues.add(i+1);
Gson gson = new Gson(); Gson gson = new Gson();

@ -25,12 +25,12 @@ import java.util.Date;
//同时创建普通索引和组合索引,注意普通索引每个索引名都不同,注意组合索引每个索引名都相同 //同时创建普通索引和组合索引,注意普通索引每个索引名都不同,注意组合索引每个索引名都相同
@Table(indexes = {@Index(name = "idx_dataDate", columnList = "dataDate"),@Index(name = "idx_locationDesc", columnList = "locationDesc"),@Index(name = "idx_dataHour", columnList = "dataHour"),@Index(name = "idx_dataMinute", columnList = "dataMinute"),@Index(name = "data_date_location_desc", columnList = "dataDate"),@Index(name = "data_date_location_desc", columnList = "locationDesc")}) @Table(indexes = {@Index(name = "idx_dataDate", columnList = "dataDate"),@Index(name = "idx_locationDesc", columnList = "locationDesc"),@Index(name = "idx_dataHour", columnList = "dataHour"),@Index(name = "idx_dataMinute", columnList = "dataMinute"),@Index(name = "data_date_location_desc", columnList = "dataDate"),@Index(name = "data_date_location_desc", columnList = "locationDesc")})
public class Temperature implements Serializable { public class Temperature implements Serializable {
// @Id
// @GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "主键")
@Id @Id
@GeneratedValue(strategy = GenerationType.SEQUENCE,generator="temperature_seq") @GeneratedValue(strategy = GenerationType.IDENTITY)
@SequenceGenerator(name="temperature_seq", sequenceName="temperature_seq_name_appserver") @ApiModelProperty(value = "主键")
// @Id
// @GeneratedValue(strategy = GenerationType.SEQUENCE,generator="temperature_seq")
// @SequenceGenerator(name="temperature_seq", sequenceName="temperature_seq_name_appserver")
private Long id; private Long id;
@ApiModelProperty(value = "温度") @ApiModelProperty(value = "温度")

@ -29,7 +29,7 @@ public class ScheduledService {
* @description: * @description:
* @Param: null * @Param: null
*/ */
//@Scheduled(cron = "0 14 23 14 12 *") //@Scheduled(cron = "30 31 0 18 12 *")
public void getNmcWeatherProvince() { public void getNmcWeatherProvince() {
ResponseDto responseDto = jdbcDemoController.queryList(); ResponseDto responseDto = jdbcDemoController.queryList();
//System.out.println(new Gson().toJson(responseDto)); //System.out.println(new Gson().toJson(responseDto));

@ -12,6 +12,7 @@ import java.sql.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
@Slf4j @Slf4j
public class JdbcUtil { public class JdbcUtil {
@ -56,15 +57,17 @@ public class JdbcUtil {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
columns.stream().forEach(t -> { columns.stream().forEach(t -> {
try { try {
if(t.equals("create_date")){ // if(t.equals("create_date")){
Timestamp timestamp = rs.getTimestamp("create_date"); // Timestamp timestamp = rs.getTimestamp("create_date");
Date date = new Date(timestamp.getTime()); // Date date = new Date(timestamp.getTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
jo.put(t, sdf.format(date)); // jo.put(t, sdf.format(date));
}else{ // }else{
Object value = rs.getObject(t); Object value = rs.getObject(t);
jo.put(t, value); String key = t;
} String keyLow = key.toLowerCase(Locale.ROOT);
jo.put(keyLow, value);
//}
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -11,16 +11,16 @@ spring:
#url: jdbc:mysql://127.0.0.1:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true #url: jdbc:mysql://127.0.0.1:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true
#url: jdbc:mysql://192.168.2.18:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true #url: jdbc:mysql://192.168.2.18:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true
#url: jdbc:mysql://192.168.1.24:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true #url: jdbc:mysql://192.168.1.24:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true
# url: jdbc:mysql://192.168.3.7:3306/temperature?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true url: jdbc:mysql://192.168.3.7:3306/appserver?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true
# driverClassName: com.mysql.cj.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
# username: root username: root
# password: Skyinno251, password: Skyinno251,
driverClassName: oracle.jdbc.driver.OracleDriver # driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@192.168.3.7:1521/orcl # url: jdbc:oracle:thin:@192.168.3.7:1521/orcl
username: appserver # username: appserver
password: appserver # password: appserver
jpa: jpa:
database: oracle # 配置 DBMS 类型 database: mysql # 配置 DBMS 类型
show-sql: true # 配置是否将执行的 SQL 输出到日志 show-sql: true # 配置是否将执行的 SQL 输出到日志
open-in-view: true open-in-view: true
hibernate: hibernate:

Loading…
Cancel
Save