Java SQL Table isExistsDerbyTable(Connection derbyConnection, String schema, String table)

Here you can find the source of isExistsDerbyTable(Connection derbyConnection, String schema, String table)

Description

is Exists Derby Table

License

Open Source License

Declaration

public static boolean isExistsDerbyTable(Connection derbyConnection, String schema, String table)
            throws SQLException 

Method Source Code

//package com.java2s;
/*//  ww w .  j a  va  2  s  .co  m
 * (C) Copyright IBM Corp. 2008
 *
 * LICENSE: Eclipse Public License v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 */

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    public static boolean isExistsDerbyTable(Connection derbyConnection, String schema, String table)
            throws SQLException {
        ResultSet rs = derbyConnection.getMetaData().getTables(null, schema, table, null);
        boolean isTableExists = rs.next();
        // Must close ResultSet - vital step - otherwise we can hit db locks
        // seen with: vti.TestICARESTSelfSameQueryJoinsCached.testDistributedSearchSelfSameJoinRestrictedFetchSizeAgainstOtherNode
        rs.close();
        return isTableExists;
    }
}

Related

  1. getTableSize(Connection conn, String tableName)
  2. getTableSize(final Statement statement, final String schema, final String table, boolean scope)
  3. getTotalRows(String tableName, Statement statement)
  4. hasTable(Connection conn, String schemaName, String tableName)
  5. hasTable(String TableName, Connection conn)
  6. isFileImportable(File file, String prefix)
  7. isTableEmpty(Connection con, String schemaName, String tableName)
  8. normalizeTableName(String table, Connection con)
  9. parse(Connection connection, String tableName, String type)