db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dockery, Michael E SFC NG NG NGB" <michael.dock...@us.army.mil>
Subject getconnection error using Derby and tomcat6/jndi
Date Wed, 27 Feb 2008 03:29:08 GMT
I am trying to get derby working
 on tomcat6 via jndi

my context.xml looks like this:
<?xml version='1.0' encoding='utf-8'?>
<Context path="/testApp" docBase="testApp" antiJARLocking="true">
   <!-- ensure the db server is started and that tomcat can find the db 
driver -->
 <Resource    name="jdbc/derbyDB" auth="Container"
         maxActive="10"  maxIdle="5"        />

my web.xml looks like this
   <description>Setup Database</description>


my java code gets the datasource from jndi just fine
  envCtx = (javax.naming.Context) initCtx.lookup("java:comp/env");

but it fails when i try to getConnection
   conn = ds.getConnection();

i am not sure what i am doing wrong here.

Any ideas?

Thank you

note: the commandline ij tool works fine also:
   C:\Documents and Settings\Lisa>ij
   ij version 10.3
   ij> connect 'jdbc:derby://';
   ij> show tables;
   TABLE_SCHEM         |TABLE_NAME                    |REMARKS
   SYS                 |SYSALIASES                    |

View raw message