Forums Register Login

How to add mm.mysql jdbc driver to tomcat 4?

+Pie Number of slices to send: Send
Hi,
I installed tomcat 4.0.4 full version on my redhat 7.3. I configured it properly and it showed the default page of http://localhost:8080.
I want to install the mm.mysql jdbc driver.
However, I cannot find out where is the Tomcat4 installed?
When I whereis tomcat4, it showed:
/etc/tomcat4
/usr/bin/tomcat4
They are not the folder to include the lib directory for me to put the mm.mysql jdbc driver.
Where is the tomcat4/lib? How can I find it?
Thanks
Andrew
+Pie Number of slices to send: Send
Hi,
I found the tomcat4/lib which is located under /var.
I have the same setting on win2k and the following program runs fine, i.e. jsp can connect to mysql. However, when I used the same file and database, it did not work under linux box. Why and how should I fix it?
Here is the program:
<html>
<head><title>Employee List</title></head>
<body>
<%@ page import="java.sql.*" %>
<table border=1 width="70%">
<tr><th>Last name</th><th>First name</th></tr>
<%
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn=DriverManager.getConnection("jdbc:mysql://localhost/employees");
st = conn.createStatement();
rs = st.executeQuery("select * from employees");
while(rs.next()) {
%>
<tr><td><%= rs.getString("lname_txt") %></td>
<td><%= rs.getString("fname_txt") %></td></tr>
<% } %>
</table>
<%
} catch (Exception ex) {
ex.printStackTrace();
%>
</table>
Ooops, somthing bad happened:
<%
} finally {
if (rs != null) rs.close();
if (st != null) st.close();
if (conn != null) conn.close();
}
%>
</body>
</html>

** employees is the name of the database.
+Pie Number of slices to send: Send
Sorry, the way that I installed the mm.mysql is correct. What's wrong is the conn in the jsp file:
conn=DriverManager.getConnection("jdbc:mysql://localhost/employees", "user", "pwd");
Thanks for help
Andrew
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1072 times.
Similar Threads
Please help, Connector J mysql problem
"Unable to Load Driver" - MySQL
How to set server.xml?
problem using Tomcat with Jboss
Need Help starting Tomcat
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:12:31.