<html><body>
<%@ page import="java.sql.*" %>
<%
String user="root@localhost"; // root itself
String password="pwdl";
String connectionURL = "jdbc:mysql://localhost/Database_name";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, user, password);
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * table");
while (rs.next())
{
out.println(rs.getString("name")+"<br>"+rs.
getString("emailid")+"<br>"+rs.getString("contents
")+"<br>");
}
rs.close();
%>
</body></html>
Rajesh.D.N 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Rajesh.D.N 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
lookof2day 6 Junior Poster in Training
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.