0

i m trying to connect jsp page to mysql. i have insatlled jsp-mysql connector. but still not able to connect to mysql. pla anybody help me.
thanks

2
Contributors
2
Replies
4
Views
11 Years
Discussion Span
Last Post by mishu007
0

i m trying to connect jsp page to mysql. i have insatlled jsp-mysql connector. but still not able to connect to mysql. pla anybody help me.
thanks

i also tried with thsi code
but i am getting the exception as
javax.servlet.ServletException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.io.EOFException
the code is
<%@ page import="java.sql.*" %>
<%
String connectionURL = "jdbc:mysql://localhost:8080/login?user=user;password=pass";
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 contact");

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

rs.close();
%>

</body></html>

0

First of all try to match jsp-mysql connector with MYSQL version.. because it tooks me 15 days to match that... Atlast with the help of MYSQL4.0 i can accomplish my connection.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.