判斷數據庫中某張表是否存在,hibernate中取得connection參考另一片日誌。java
java.sql.Connection con = getYourConnection(); ResultSet rs = con.getMetaData().getTables(null, null, "yourTable", null); if (rs.next()) { //yourTable exist }else { //yourTable not exist }