protected boolean tableExists(Connection connection) throws SQLException { DatabaseMetaData metadata = connection.getMetaData(); String schemaName = getDatabaseSchemaName(connection); try (ResultSet rs = metadata.getTables(null, schemaName, table.getPhysicalName(), new String[] { "TABLE" })) { boolean exists = rs.next(); log.trace("Checking if table {} exists: {}", table.getPhysicalName(), exists); return exists; } }
DatabaseMetaData metadata = connection.getMetaData(); String schemaName = getDatabaseSchemaName(connection); try (ResultSet rs = metadata.getColumns(null, schemaName, table.getPhysicalName(), "%")) { while (rs.next()) { String schema = rs.getString("TABLE_SCHEM");