db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolf Bublitz <wolf.bubl...@uni-dortmund.de>
Subject Re: checking if table exists
Date Wed, 03 Oct 2007 13:49:21 GMT
That`s the way it should be, but does not work either.

         String[] names = { "TABLE" };
         ResultSet result = null;
         DatabaseMetaData metadata = null;

         try {
             metadata = dbConnection.getMetaData();
             result = metadata.getTables(null, null, null, names);
             while(result.next()) {
                 System.out.println(result.getString("TABLE_NAME"));
             }
         } catch(java.sql.SQLException e) {
             e.printStackTrace();
         }



Am 03.10.2007 um 15:44 schrieb Bryan Pendleton:

>>             while((result.next()) & (tableExists = false)) {
>
> Is this possibly a typo? Make sure it says:
>
>              while((result.next()) && (tableExists == false)) {
>
> You want to do a logical and, not a bitwise and; also you want
> to do a comparison, not an assignment.
>
> thanks,
>
> bryan
>


Mime
View raw message