| | |
| | | //添加9度通讯线程
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11012");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute(" INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('11012', 'BMS_LD-9_DEV', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_LD-9_DEV', '2', 'v1.101', '9度设备通讯线程', '300');");
|
| | | sql.sqlMysqlExecute(" INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('11012', 'BMS_LD9_MONITOR', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_LD9_MONITOR', '2', 'v1.101', '9度设备通讯线程', '300');");
|
| | | }
|
| | | |
| | | //添加6度通讯线程
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM "+ Sql_Mysql.ProcessSurvey_Table + " WHERE ProcessId = 11013");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute(" INSERT INTO " + Sql_Mysql.ProcessSurvey_Table + "(ProcessId,ProcessName,ProcessTime,Process_starttime,ServerName,ServerFlag,ProcessVersion,note,OutTime) VALUES ('11013', 'BMS_LD6_MONITOR', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 'BMS_LD6_MONITOR', '2', 'v1.101', '6度设备通讯线程', '300');");
|
| | | }
|
| | |
|
| | | } catch (SQLException e) {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * 创建设备重启计划表
|
| | | * @param pool
|
| | | * @param recreate
|
| | | */
|
| | |
| | | " UNIQUE KEY `index_dev_id` (`dev_id`) USING BTREE" +
|
| | | ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
| | | Sql_Mysql sql = new Sql_Mysql(pool.getConn());
|
| | | ResultSet res = null;
|
| | | try {
|
| | | if(recreate) {
|
| | | sql.sqlMysqlExecute(sql_str_del);
|
| | | }
|
| | | sql.sqlMysqlExecute(sql_str);
|
| | | //添加上一次重启时间字段
|
| | | res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
|
| | | + " WHERE table_schema='web_site'"
|
| | | + " AND table_name='tb_dev_restart_plan'"
|
| | | + " AND column_name='last_restarttime'");
|
| | | if(false == res.next()) {
|
| | | sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.Dev_Restart_Plan_Table |
| | | + " ADD COLUMN last_restarttime datetime NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '上一次重启时间';");
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | } finally {
|
| | | if(res != null) {
|
| | | try {
|
| | | res.close();
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | sql.close_con();
|
| | | }
|
| | | }
|