Hello friends i m trying to connect my jsp code with mysql front but i found myself helpless.
please guys help me.....this is the code.
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.io.*"%>
<%@ page language="java" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Date"%>
<html>
<head>
<title>Congrats You Are now Part Of us</title>
</head>
<body>
<%
// get parameters from the request
String firstName = request.getParameter("FirstName");
String lastName = request.getParameter("LastName");
String emailAddress = request.getParameter("EmailiD");
%>
<h1>Thanks for joining our email list</h1>
<p>Here is the information that you entered:</p>
<%Connection con;
PreparedStatement stmt;
ResultSet rs;
String db="jdbc:mysql:///Email";
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection(db,"root","123456");
stmt=con.prepareStatement("select * from Emailid");
rs=stmt.executeQuery();%>
<table cellspacing="5" cellpadding="5" border="1">
<tr>
<td align="right">First name:</td>
<td><%= firstName %></td>
</tr>
<tr>
<td align="right">Last name:</td>
<td><%= lastName %></td>
</tr>
<tr>
<td align="right">Email address:</td>
<td><%= emailAddress %></td>
</tr>
</table>
<p>To enter another email address, click on the Back <br>
button in your browser or the Return button shown <br>
below.</p>
<form action="join_email_list.html" method="post">
<input type="submit" value="Return">
</form>
</body>
</html>
thnks in advance.....:)