|
@@ -74,9 +74,10 @@ public class JdbcUtils {
|
|
String splitStr = "_";
|
|
String splitStr = "_";
|
|
//3.获取用于向数据库发送sql语句的statement
|
|
//3.获取用于向数据库发送sql语句的statement
|
|
String[] s = tableName.split(splitStr);
|
|
String[] s = tableName.split(splitStr);
|
|
- Integer year = Integer.valueOf(s[2]);
|
|
|
|
|
|
+ String replace = tableName.replace(s[s.length - 1], "");
|
|
|
|
+ Integer year = Integer.valueOf(s[s.length - 1]);
|
|
year = year + 1;
|
|
year = year + 1;
|
|
- String newTableName = s[0] + splitStr + s[1] + splitStr + year;
|
|
|
|
|
|
+ String newTableName = replace + year;
|
|
//4.向数据库发sql
|
|
//4.向数据库发sql
|
|
String sql = "select table_name from information_schema.tables where table_schema=? AND table_name=? ";
|
|
String sql = "select table_name from information_schema.tables where table_schema=? AND table_name=? ";
|
|
//3.获取用于向数据库发送sql语句的Preperedstatement
|
|
//3.获取用于向数据库发送sql语句的Preperedstatement
|
|
@@ -92,7 +93,7 @@ public class JdbcUtils {
|
|
//3.获取用于向数据库发送sql语句的Preperedstatement
|
|
//3.获取用于向数据库发送sql语句的Preperedstatement
|
|
flage = statement.execute(sql);
|
|
flage = statement.execute(sql);
|
|
}
|
|
}
|
|
- close(conn,st,rs);
|
|
|
|
|
|
+ close(conn, st, rs);
|
|
return flage;
|
|
return flage;
|
|
|
|
|
|
}
|
|
}
|