You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Frankson <df...@qwest.net> on 2001/10/24 00:46:46 UTC
JDBC tyrex pool with JNetDirect JDBC drivers
I'm struggling to get the JDBC-JNDI-Tyrex connection pool working with
the Netdirect JDBC driver and I keep getting a cast exception error
java.lang.ClassCastException: tyrex.jdbc.xa.EnabledDataSource
I configured the JBDC according to the Tomcat 4.0 docs, but I must be
missing something...
web.xml -
<resource-ref>
<description>Campus Datasource</description>
<res-ref-name>jdbc/campus</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
server.xml -
<Resource name="jdbc/campus" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/campus">
<parameter>
<name>user</name><value>sa</value>
</parameter>
<parameter>
<name>password</name><value>...</value>
</parameter>
<parameter>
<name>driverClassName</name><value>com.jnetdirect.jsql.JSQLDriver</value>
</parameter>
<parameter>
<name>driverName</name>
<value>jdbc:JSQLConnect://localhost:1433/database=campus</value>
</parameter>
</ResourceParams>
Application -
Context env = (Context) new InitialContext().lookup("java:comp/env");
DataSource ds = (DataSource) env.lookup("jdbc/campus");
The J-netdirect drivers come with a JSQLXADataSource class, do I somehow use
this instead? If anyone has figured this out, I'd appreciate a tip.
Dave