private boolean tableExists(String namespace, String tableName) {
    """
	Helper method to determine if a table exists within a namespace.
    """
        // Preempt SQL check with null check of either namespace or table name.
        if (namespace == null || tableName == null) return false;
        try {
            // This statement is postgres-specific.
            PreparedStatement tableExistsStatement = connection.prepareStatement(
                "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = ? AND table_name = ?)"
            );
            tableExistsStatement.setString(1, namespace);
            tableExistsStatement.setString(2, tableName);
            ResultSet resultSet = tableExistsStatement.executeQuery();
            resultSet.next();
            return resultSet.getBoolean(1);
        } catch (SQLException e) {
            e.printStackTrace();
            return false;
        }
    }
private boolean tableExists(String namespace, String tableName) {
        // Preempt SQL check with null check of either namespace or table name.
        if (namespace == null || tableName == null) return false;
        try {
            // This statement is postgres-specific.
            PreparedStatement tableExistsStatement = connection.prepareStatement(
                "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = ? AND table_name = ?)"
            );
            tableExistsStatement.setString(1, namespace);
            tableExistsStatement.setString(2, tableName);
            ResultSet resultSet = tableExistsStatement.executeQuery();
            resultSet.next();
            return resultSet.getBoolean(1);
        } catch (SQLException e) {
            e.printStackTrace();
            return false;
        }
    }
private boolean tableExists ( String namespace , String tableName ) { // Preempt SQL check with null check of either namespace or table name. if ( namespace == null || tableName == null ) return false ; try { // This statement is postgres-specific. PreparedStatement tableExistsStatement = connection . prepareStatement ( "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = ? AND table_name = ?)" ) ; tableExistsStatement . setString ( 1 , namespace ) ; tableExistsStatement . setString ( 2 , tableName ) ; ResultSet resultSet = tableExistsStatement . executeQuery ( ) ; resultSet . next ( ) ; return resultSet . getBoolean ( 1 ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; return false ; } }
Helper method to determine if a table exists within a namespace.
Helper method to determine if a table exists within a namespace .