db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren" <m.v.lunte...@gmail.com>
Subject Re: MetaData problem
Date Wed, 11 Oct 2006 18:38:14 GMT
On 10/11/06, NLA Systems Ltd <nla@keyworld.net> wrote:
> Hello all
>
> This is my first post to this list.
>
> I am connecting to a Derby database in embedded mode among other databases.
> I have the code below to get all the columns of a table. This code works
> fine with all my other databases but not with Derby. It seems that the
> getColumns() method is returning an empty resultset. I hope someone can
> give me a hint on why this is happening. Thanks a lot!
>
>
>
> DatabaseMetaData dbmd=dbConn.dbConnection.getMetaData();
> ResultSet rs=dbmd.getColumns(null,null,"myTable", null);
>
> while (rs.next()) {
>                .......
>                     }
>                 }
>
> I am using release 10.1.2.0
>
> Regards
> Noel
>
Hi Noel,

There's not much information as you didn't provide the create table
statement, nor indicated whether derby.log had any useful details, but
at a guess, I would think it can't find your table...Or maybe there
are two tables and the rows went into one & you're retrieving from the
other.
I suggest you to check the following things:
- was the table created within a specific schema?
     If when you created the table, you started your Derby process
with a specific login/user, then it's likely the table was created
under that user, i.e. the table is really 'firstuser.myTable'.
     To access a table like this, you can either fully qualify the
name, login with the same user, or first do an explicit 'set schema
firstuser'.
- confirm that the table was created in the mixed case you specify.
    By default, Derby will uppercase the table (and column,etc...)
identifiers. If you do not want this, you should double quote the
table name at creation time.

To see what is really happening, you can look in the derby.log file;
it should have been created automatically in the same location as the
database. To get more information in it, create a derby.properties
file in the directory where you start derby (or where the database got
created), and add the following:
derby.infolog.append=true
derby.language.logStatementText=true
derby.stream.error.logSeverityLevel=0

To see how your tables got created, open an ij session, connect to
your database, and select * from sys.systables.

HTH
Myrna

Mime
View raw message