944,111 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 34605
  • JSP RSS
Apr 20th, 2006
0

connecting jsp with mysql database

Expand Post »
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
Similar Threads
Reputation Points: 11
Solved Threads: 0
Junior Poster
aarya is offline Offline
139 posts
since Sep 2005
Apr 20th, 2006
0

Re: connecting jsp with mysql database

Quote originally posted by aarya ...
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>
Reputation Points: 11
Solved Threads: 0
Junior Poster
aarya is offline Offline
139 posts
since Sep 2005
Jul 26th, 2006
0

Re: connecting jsp with mysql database

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mishu007 is offline Offline
2 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: How to Deploy the Web applications(JSP) on weblogic server
Next Thread in JSP Forum Timeline: The requested resource (/jsp-examples/) is not available





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC