tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sayre Robert <>
Subject RE: JNDI DataSource Problem: MS SQL Server
Date Wed, 17 Apr 2002 15:09:32 GMT
Here's what I have with the Merant SequeLink driver and SQL Server 7. I get
a connection, but I haven't yet checked to see if they're actually being
If you're using a different driver, use the "jar -tf" command to see what
the class names are. The names should be similar.

Robert Sayre


<Resource name="jdbc/dbTest" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/dbTest">



code sample:

Context initCtx;
Context envCtx;
ConnectionPoolDataSource cpds;
DatabaseMetaData dma = null;
PooledConnection pconn = null;
Connection conn = null;
	initCtx = new InitialContext();
	envCtx = (Context) initCtx.lookup("java:comp/env");
	cpds = (ConnectionPoolDataSource) envCtx.lookup("jdbc/eSpeedForm");
	pconn = cpds.getPooledConnection("xxx", "xxx");
	conn = pconn.getConnection();
}catch (SQLException se){
	//clean up

-----Original Message-----
From: Peter D Wilson []
Sent: Tuesday, April 16, 2002 11:19 PM
To: Tomcat Users List
Subject: JNDI DataSource Problem: MS SQL Server

Could somebody provide jakarta-tomcat-4.0.3, server.xml + web.xml + java
code,  working fragments similar to those that Eichfelder, Frank provided
earlier today on this mail list. I am using MS SQL Server 6.5, where the
direct DriverManager approach outside of Tomcat works perfectly.

In the JNDI approach under Tomcat, I can list context, "jdbc" in context,
"java:comp/env" and get my ResourceRef, "JobsDataSource" from the default
context in server.xml listed, but I am unable to get a DataSource (or
ConnectionPoolDataSource) returned.

This is a very frustrating exercise!

Thank you for your help,


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message