db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Ehmann <behmannl...@gmail.com>
Subject unable to access DB on classpath
Date Tue, 29 Aug 2006 12:59:22 GMT
Hey everyone,

First, forgive me if this is a dumb question, but I can't seem to  
find the answer in the derby documentation.

I am developing a web app on tomcat that uses container managed  
security and I would like to migrate the authentication data from  
mysql to an embedded derby db.  I have created the DB, using ij, as  
follows:

driver 'org.apache.derby.jdbc.EmbeddedDriver';
connect 'jdbc:derby:AerosmithDB;create=true';
create table users (username varchar(15) not null primary key,  
password varchar(35) not null);
create table userroles ( username varchar(15) not null, role varchar 
(15) not null, primary key (username, role));
insert into users(username, password) values ('test', 'test');
insert into userroles(username, role) values ('test', 'registereduser');
commit;
disconnect;

I then jar the "AerosmithDB" directory into a jar and place it on the  
classpath.  Unfortunately, using ij, I am not able to connect to the  
database that is on the classpath.  See below:

$ echo $CLASSPATH
/Users/brian/src/eclipse/workspace/Aerosmith/WebContent/WEB-INF/ 
AerosmithDB.jar:/Developer/Java/db-derby-10.1.3.1/lib/derby.jar:/ 
Developer/Java/db-derby-10.1.3.1/lib/derbytools.jar
$ ij
ij version 10.1
ij> driver 'org.apache.derby.jdbc.EmbeddedDriver';
ij> connect 'jdbc:derby:/AerosmithDB';
ERROR XJ004: Database '/AerosmithDB' not found.
ij> connect 'jdbc:derby:AerosmithDB';
ERROR XJ004: Database 'AerosmithDB' not found.
ij> connect 'jdbc:derby:classpath:/AerosmithDB';
ERROR XJ004: Database 'classpath:/AerosmithDB' not found.
ij> connect 'jdbc:derby:classpath:AerosmithDB';

Any ideas?

Thanks,

Brian

Mime
View raw message