| | |
| | | |
| | | final public static String DB_DEV_HISTORY = "`db_dev_history`"; //设备历史实时数据库 |
| | | |
| | | final public static String DB_DEV_TESTPARAM = "`db_dev_testparam`"; //设备历史实时数据库 |
| | | //--------------------------------------------------------------------------------------------// |
| | | public final static String TB_HardDevSmsState = "tb_hard_dev_sms_state"; |
| | | //--------------------------------------------------------------------------------------------// |
| | |
| | | /***************************** db_fbo_testdata 数据库 ************************************/ |
| | | public final static String Fbotestdata_Inf_Table = DB_FBO_TESTDATA + ".`tb_fbotestdata_inf`"; |
| | | |
| | | |
| | | /***************************** db_dev_testparam 数据库 **********************************/ |
| | | public final static String Batt_TestParam_Table = DB_DEV_TESTPARAM + ".tb_batt_testparam_"; //设备放电参数记录表 |
| | | |
| | | |
| | | //--------------------------------------------------------------------------------------------// |
| | |
| | | return exist; |
| | | } |
| | | |
| | | /** |
| | | * 检查tb表是否存在 |
| | | * @param tb 表名不带数据库名 |
| | | * @return true:存在 false:不存在 |
| | | * @throws SQLException |
| | | */ |
| | | public boolean sqlCheckIfTableExist(String tb) |
| | | { |
| | | String sql_str = " SELECT COUNT(*) as count FROM information_schema.TABLES " + |
| | | " WHERE table_name ='" + tb + "';"; |
| | | ResultSet res = sqlMysqlQuery(sql_str); |
| | | boolean exist = false; |
| | | try { |
| | | if (null != res && res.next()) { |
| | | int count = res.getInt("count"); |
| | | if(count > 0) { |
| | | exist = true; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } finally{ |
| | | if(null != res) { |
| | | try { |
| | | res.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return exist; |
| | | } |
| | | |
| | | |
| | | |
| | | //执行sql语句 |
| | | public void sqlMysqlExecute(String sql_str) throws SQLException |
| | | { |
| | |
| | | } |
| | | mysql_con.setAutoCommit(true); |
| | | } catch (SQLException e1) { |
| | | // TODO Auto-generated catch block |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | return exe_res; |
| | | } |
| | | |