蓄电池监控管理平台数据库初始化程序
DELL
2024-03-27 3e14a623345669722d42cae5914d4ade70fc5c9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.database_util;
 
import java.sql.SQLException;
import java.util.Date;
 
import com.base.Com;
import com.sql.MysqlConnPool;
import com.sql.Sql_Mysql;
 
public class DB_Batt_History {
    
    public static void init(MysqlConnPool pool, boolean recreate) {
        System.out.println(" db_batt_history init start at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
        
        createDB_BATT_HISTORY(pool);
        
        
        System.out.println(" db_batt_testdata init end at " + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
        
    }
    
    /**
     *     ´´½¨     db_batt_history Êý¾Ý¿â
     * @param pool
     */
    public static void createDB_BATT_HISTORY(MysqlConnPool pool) {
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            sql.sqlMysqlExecute("CREATE DATABASE IF NOT EXISTS " + Sql_Mysql.DB_BATT_HISTORY);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
}