tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sayre Robert <say...@rappdigital.com>
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
pooled. 
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
sayrer@rappdigital.com

server.xml:

<Resource name="jdbc/dbTest" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/dbTest">
	
<parameter><name>factory</name><value>com.merant.sequelink.jdbcx.datasource.
SequeLinkDataSourceFactory</value></parameter>
	<parameter><name>user</name><value>xxx</value></parameter>
	<parameter><name>password</name><value>xxx</value></parameter>
	<parameter><name>portNumber</name><value>19996</value></parameter>
	
<parameter><name>serverName</name><value>000.00.0.0</value></parameter>
	<parameter><name>databaseName</name><value>dbTest<value></parameter>
</ResourceParams>

web.xml:

<resource-ref>
	  <description>description</description>
	  <res-ref-name>jdbc/dbTest</res-ref-name>
	
<res-type>com.merant.sequelink.jdbcx.datasource.SequeLinkDataSource</res-typ
e>
	  <res-auth>Container</res-auth>
	  <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

code sample:

Context initCtx;
Context envCtx;
ConnectionPoolDataSource cpds;
DatabaseMetaData dma = null;
PooledConnection pconn = null;
Connection conn = null;
	
try{
	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){
	...
}finally{
	//clean up
	...
}


	
-----Original Message-----
From: Peter D Wilson [mailto:peter@dflora.com]
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,

Peter



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

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