tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aris Javier" <>
Subject RE: Connecting to MS Access DB
Date Mon, 02 Aug 2004 01:01:24 GMT

Did you make your DSN as "System DSN" ?
Don't make your DSN inside "User DSN" when running
Tomcat as a service...

I've been using Tomcat and Access under win2k... and don't
have problems...

-----Original Message-----
From: Wade Chandler [] 
Sent: Monday, August 02, 2004 3:18 AM
To: Tomcat Users List
Subject: Re: Connecting to MS Access DB

Muhammad Khalid Sohail Khan wrote:
> Hi everybody,
> I am a student and new to tomcat. I want to use simple database under
> MS Access. I have written a simple servlet, which just insert some 
> data into table. But I am getting following exception
> "org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory ([Microsoft][ODBC Driver Manager] Data
source name
> not found and no default driver specified) "
> (just console, main[]) and the connection is successful. I use the
> same DriverManager Connection strings but it fails when going thru the
> Servlet engine in Tomcat.
>  Could somebody help me, I am struggling for last many days..
> Thanks in advance.
> following is the code which I am using to get connection
> InitialContext initCtx = new InitialContext();
> DataSource ds = (DataSource)
> con = ds.getConnection();
> Here is my configuration
> Server.xml
> <DefaultContext>
> <Resource name="jdbc/Address" auth="Container"
> <ResourceParams name="jdbc/Address">
> <parameter>
> <name>driverClassName</name>
> <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:odbc:Address</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>student</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>student</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>20</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>30000</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>100</value>
> </parameter>
> </ResourceParams>
> </DefaultContext>
> and
> web.xml
> <resource-ref>
> <res-ref-name>jdbc/Address</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do some searching in the archives.  Myself and others have talked about 
this to people at different times.  Try running tomcat not as a service,

but as a standalone application and you'll find that it will work for 
you, so it deals with a security setting some where on your computer.  I

assume this is on a 2000/XP machine.  You may have to give access to 
some registry entries to the user the service is running as for this to 
work properly.  Anyways, it's a security issue in one way or another or 
it's a path related issue (the user the service is running as doesn't 
have all the paths needed for some native libs or something).  Try 
adding the user the service is running as to all the directories under 
tomcat recursively, possibly some registry entries, and possibly some 
dll's for the access database drivers.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message