Tomcat version is 4.1.29 on Windows XP.  I'm attempting to connect to
SQL Server.  The JDBC driver JARs are in CATALINA_HOME\common\lib, and
since everything works fine if I manually load the driver via
Class.forName(), I don't think my problem is related to my driver files
location.  When attempting to use getConnection(), however, I get the
dreaded "Cannot create JDBC driver of class '' for connect URL 'null',
cause: No suitable driver" error.  The highlights of my configuration
are below.

Two comments:


1. You don't mention a ResourceLink. When you define a Resource as global, you need to use a ResourceLink in the definition of the context of the application. In your case, something like

<ResourceLink global="jdbc/mydb" name="jdbc/mydb" type="javax.sql.DataSource" />

inside the Context tag of the server.xml COULD work.

2. I'm saying COULD in the previous comment because I had the same problem and could not solve it with Tomcat 4.1.29.
Using 5.0.16 or 5.0.18 everything works fine.


I have something like:

----------------------------
server.xml
----------------------------
<GlobalNamingResources>
<Resource name="GlobalDataSource" auth="Container" type="javax.sql.DataSource"
description="The database." />
    <ResourceParams name="GlobalDataSource">
    ...
    </ResourceParams>
</GlobalNamingResources>


---------------------------
Catalina/host/myapp.xml
---------------------------
<Context ...>
<ResourceLink global="GlobalDataSource" name="jdbc/mydb" type="javax.sql.DataSource" />
</Context>



Note that there's no need of using a resource-ref in web.xml.


-----------------------------------
Julio C�sar Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to