Hi,
I know this has been covered before, and I've searched the archives, but
none of the solutions posted seemed to work. Am I missing something?
I am using Tomcat 4.03, JDK 1.4, and Sybase JConn 5.5
Here's what I did:
I installed the appropriate applications.
I put jconn2.jar in CATALINA_HOME/common/lib
My settings are as follows
server.xml
<Resource name="jdbc/setsDataSource" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/setsDataSource">
<parameter><name>driverClassName</name>
<value>com.sybase.jdbc2.jdbc.SybDriver</value>
</parameter>
<parameter><name>url</name>
<value>jdbc:sybase:Tds:servername:4946/database</value>
</parameter>
<parameter><name>user</name><value>username</value></parameter>
<parameter><name>password</name><value>password</value></parameter>
</ResourceParams>
web.xml
<resource-ref>
<description>Sets Database</description>
<res-ref-name>jdbc/setsDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
I have a method that has this
Context ctx = new InitialContext();
Context envCtx = (Context) ctx.lookup("java:comp/env/");
DataSource ds = (DataSource) envCtx.lookup("jdbc/setsDataSource");
if (ds==null)
throw new DatasourceUnavailableException("Unable to obtain
datasource: "+name);
try {
conn = ds.getConnection();
catch { blah blah....
That getConnection() part throws a SQLException....
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
at
tyrex.jdbc.xa.EnabledDataSource.getConnection(EnabledDataSource.java:233)
at
tyrex.jdbc.xa.EnabledDataSource.getConnection(EnabledDataSource.java:204)
at
com.gs.ed.sh.SetsInitializer.getConnection(SetsInitializer.java:83)
at com.gs.ed.sh.SetsInitializer.reload(SetsInitializer.java:111)
at com.gs.ed.sh.SetsInitializer.load(SetsInitializer.java:100)
at com.gs.ed.sh.SetsInitializer.init(SetsInitializer.java:61)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
6)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3266)
at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2479)
at
org.apache.catalina.loader.WebappContextNotifier.run(WebappLoader.java:1329)
at java.lang.Thread.run(Thread.java:536)
Thanks in advance.
Dean Chen
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>