久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      java判斷數(shù)據(jù)庫是否存在

      java判斷數(shù)據(jù)庫是否存在

      java判斷數(shù)據(jù)庫是否存在的代碼:

      public static boolean isExistDatabase(String database) {         Connection conn = null;         Statement stmt = null;         ResultSet rs = null;// 數(shù)據(jù)庫結(jié)果集         try {             conn = getConnection();             stmt = conn.createStatement();             String sql = "SELECT COUNT(*) FROM information_schema.schemata WHERE schema_name="" + database + """;             System.out.println(sql);             rs = stmt.executeQuery(sql);             if (rs.next()) {                 if (rs.getInt(1) == 0) {                     return false;                 } else {                     return true;                 }             }             return false;         } catch (Exception e) {             throw new TenantException(e.getMessage(), Status.INTERNAL_SERVER_ERROR);         } finally {             try {                 if (rs != null) {                     rs.close();                 }                 if (stmt != null) {                     stmt.close();                 }                 if (conn != null) {                     conn.close();                 }             } catch (SQLException e) {                 throw new TenantException("mysql關(guān)閉連接失?。?quot; + e.getMessage(), Status.INTERNAL_SERVER_ERROR);             }         }     }

      關(guān)鍵SQL語法:

      String sql = "SELECT COUNT(*) FROM information_schema.schemata WHERE schema_name="" + database + """;

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號