Thank you for your reply, Hans. The JDBC driver classes are in the webapps WEB-INF/lib directory and I was assuming that they are being found because a non-JSTL JSP page with a scriptlet block containing:

Connection con;
try {
Class.forName("org.gjt.mm.mysql.Driver");
con = DriverManager.getConnection("jdbc:mysql://myhost.noaa.gov:3306/testdb","testuser","testpass");
} catch (Exception e) {
throw (new ServletException("Error loading Driver: " +e.getMessage()));
}


seems to work fine. Does JSTL look for the Driver classes in a location other than the scriplet-based connection code?

Thanks again!

-- john





Hans Bergsten wrote:

John C Cartwright wrote:

Hello All,

I am hoping that someone can help me to get going with the SQL tags. I'm trying to connect to a mysql database using tomcat4.1.12 and version 1.0.2 of the library.

Here's my JSP:

<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql"; %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

<HTML>
<HEAD>
</HEAD>
<BODY>
<sql:setDataSource var="monitorDS"
url="jdbc:mysql://myhost.noaa.gov:3306/testdb"
driver="org.gjt.mm.mysql.Driver"
user="testuser"
password="testpass"
/>
</BODY>
</HTML>

I'm getting a:
org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: "No suitable driver"

This is because the JDBC driver classes are not found by the web
container. Make sure you have installed them in the WEB-INF/lib
directory of the application.

> [...]

Hans


--
=====================================================
John Cartwright
Associate Scientist
Geospatial Data Services Group
CIRES, National Geophysical Data Center/NOAA
(303) 497-6284
[EMAIL PROTECTED]
=====================================================




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

Reply via email to