geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <jboy...@apache.org>
Subject Re: Connecting to SystemDatabase and create table
Date Sun, 17 Apr 2005 22:43:30 GMT
Katia Aresti Gonzalez wrote:
> Hi!!!
> 
> Jeremy is right. To create the table, yo cant do it if you are not in the same 
> dir of geronimo, with the server shut down and including as well derby.jar. And 
> to connect, using the command below.
> 
> It seems that connects in the way i said before, but not really... I dont know 
> what happens, anyway, follow jeremy`s way and mine togheter :-)
> 

Both ways work, the difference is the schema in which the tables are 
created. When you connect over the network the default schema is defined 
by the user ("SYSTEM" in your example) whereas when you connect embedded 
(my way) the default schema is "APP". When inside the server using the 
SystemDatasource the connection pool is connecting embedded so the 
default schema will be "APP"

So, the table is there but your way its fully qualified name is 
SYSTEM.GENTE, my way it is APP.GENTE.

A better solution is to always fully qualify the schema name:
ij> CREATE SCHEMA MYAPP;
ij> CREATE TABLE MYAPP.GENTE;

and then in your code:
Statement.execute("SELECT * FROM MYAPP.GENTE");

--
Jeremy

Mime
View raw message