| | |
connecting jsp with mysql database
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
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
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>
![]() |
Similar Threads
- How to Connect MySQL from JSP Page (JSP)
- Please help me in connecting JSP to MySql (JSP)
- connecting java to mysql database (Java)
- copying mssql database on my local machine to a mysql database online (MySQL)
- Backing up a MySQL database (MySQL)
- Update entire Mysql DataBase with PhP (PHP)
Other Threads in the JSP Forum
- Previous Thread: Play mp3 in jsp
- Next Thread: The requested resource (/jsp-examples/) is not available
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





