protected boolean tableExists(Table t) throws SQLException {
  String sql="SELECT * FROM pg_tables WHERE " + (t.isTemporary() ? "" : ("schemaname='" + t.getSchema() + "' AND ")) + "tablename='"+ (t.isTemporary() ? (t.getSchema() + "_") : "")+ t.getName()+ "'";
  Statement stmt=dbConn.createStatement();
  try {
    ResultSet rs=stmt.executeQuery(sql);
    return rs.next();
  }
  finally {
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      SQLException e) {
      }
    }
  }
}

protected boolean tableExists ( Table t ) throws SQLException { String sql = "SELECT * FROM pg_tables WHERE " + ( t . isTemporary ( ) ? "" : ( "schemaname='" + t . getSchema ( ) + "' AND " ) ) + "tablename='" + ( t . isTemporary ( ) ? ( t . getSchema ( ) + "_" ) : "" ) + t . getName ( ) + "'" ; Statement stmt = dbConn . createStatement ( ) ; try { ResultSet rs = stmt . executeQuery ( sql ) ; return rs . next ( ) ; } finally { if ( stmt != null ) { try { stmt . close ( ) ; } catch ( SQLException e ) { } } } }
checks whether the given table exists in the currently connected database . check is made against " pg_tables " .
