Here you can find the source of isExistsTable(Connection con, String schema, String tableName)
public static boolean isExistsTable(Connection con, String schema, String tableName) throws SQLException
//package com.java2s; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static boolean isExistsTable(Connection con, String schema, String tableName) throws SQLException { DatabaseMetaData dmd = con.getMetaData(); ResultSet rs = dmd.getTables(null, schema, "%", null); try {/*ww w . ja v a 2s. com*/ tableName = tableName.toUpperCase(); while (rs.next()) { String tableNameTmp = rs.getString("TABLE_NAME"); if (tableName.equals(tableNameTmp.toUpperCase())) { return true; } } return false; } finally { rs.close(); } } }