/** * Returns true if given table exists in DB; false otherwise. * @param tableName * @param conn * @return * true if given table exists in DB; false otherwise. * @throws SQLException * @throws ClassNotFoundException */ public boolean tableExists(String tableName, Connection conn) throws SQLException, ClassNotFoundException { List<String> tn = getListOfTables(conn); if (tn.contains(tableName)) { return true; } return false; }
public ArrayList<String> getListOfTables(DBType dbType, String hostname, int portnumber, String username, String password, String dBorSIDName) throws SQLException, ClassNotFoundException { Connection conn = getConnection(hostname, portnumber, username, password, dBorSIDName); return getListOfTables(conn); }
AbstractJDBCUtil dbUtil = JDBCUtilFactory.getInstance(dbType); listOfTables = dbUtil.getListOfTables(dbType, hostname, portnumber, username, password, dBorSIDName);