• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP-Tomcat-MySQL connection problems

 
Yong Ming Wai
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using MySQL-connector-java 3.0.15,Tomcat 4.1,J2SDK 1.4.0

i am getting the following error: please help me in sorting it out javax.servlet.ServletException: Communication link failure: java.io.EOFException, underlying cause: null ** BEGIN NESTED EXCEPTION ** java.io.EOFException
Thankz
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yong Ming Wai,

I had to take my crystal ball into the shop for repair today, so I am unable to gaze into it to see the code you are using when you get this error message. If you could help us out by showing us that code here, we'd be more than happy to help. I'll let you know when my crystal ball gets back from the shop. My kid dropped it in the toilet. :roll: Kids; gotta love them.
 
Yong Ming Wai
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sheesh...thats mean..hehehe..my fault anyway..
sorry for that...everyone...
here's the code..
<html>
<head>
<title>My First JSP</title>
</head>
<body>
<%@ page import="java.sql.*" %>
<%
String connectionURL = "jdbc:mysql://localhost:8080/tailo";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>

<html><body>

<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "", "");
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM dvd");

while (rs.next()) {
out.println(rs.getString("title")+"<br>");
}

rs.close();
%>

</body></html>
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to kick yourself when I tell you this:



Tomcat listens on port 8080. What port does MySQL listen on?
 
Yong Ming Wai
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah!!i am banging my head against the wall while writing this..
I am so careless...
Thank you so much..gregg...
I really appreciate ur patience and help towards such minor problem..
hehehehe...Thankz!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!