public boolean tableExists(String table) throws DatabaseException {
  boolean result=false;
  ResultSet rs=null;
  try {
    DatabaseMetaData dbm=connection.getMetaData();
    String types[]={"TABLE"};
    rs=dbm.getTables(null,null,table,types);
    result=rs.next();
    rs.close();
  }
 catch (  SQLException e) {
    throw (new DatabaseException(e));
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return result;
}

public boolean tableExists ( String table ) throws DatabaseException { boolean result = false ; ResultSet rs = null ; try { DatabaseMetaData dbm = connection . getMetaData ( ) ; String types [ ] = { "TABLE" } ; rs = dbm . getTables ( null , null , table , types ) ; result = rs . next ( ) ; rs . close ( ) ; } catch ( SQLException e ) { throw ( new DatabaseException ( e ) ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } } return result ; }
determine if a table exists .
