| | |
| | | package com.database_util;
|
| | |
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | | import java.util.Date;
|
| | |
|
| | |
| | | " upload_usr_id int(11) NOT NULL DEFAULT '0'," +
|
| | | " upload_data_ext int(11) NOT NULL DEFAULT '0'," +
|
| | | " upload_client_type int(11) NOT NULL DEFAULT '0'," +
|
| | | " test_datatype int(11) NOT NULL DEFAULT '0' COMMENT '山西61850监测放电数据标识【0:监测放电;1:停电放电】'," + |
| | | " PRIMARY KEY (num)," +
|
| | | " KEY index_battgroup_id (BattGroupId)," +
|
| | | " KEY index_test_record_count (test_record_count)," +
|
| | | " KEY index_test_starttime (test_starttime)" +
|
| | | ") ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | ResultSet res = null;
|
| | | try {
|
| | | if(true == recreate) {
|
| | | sql.sqlMysqlExecute(sql_str01);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str02); |
| | | sql.sqlMysqlExecute(sql_str02); |
| | | |
| | | |
| | | |
| | | //新增字段test_datatype |
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='db_batt_testdata'"
|
| | | + " AND table_name='tb_batttestdata_inf'"
|
| | | + " AND column_name='test_datatype'");
|
| | | if(!res.next()){ |
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattTestDataInf_Table |
| | | + " ADD COLUMN test_datatype int(11) NOT NULL DEFAULT '0' COMMENT '山西61850监测放电数据标识【0:监测放电;1:停电放电】';");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | if(null != res) {
|
| | | try {
|
| | | res.close();
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | sql.close_con();
|
| | | }
|
| | | }
|