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"%>

<title>Congrats You Are now Part Of us</title>
// 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";
stmt=con.prepareStatement("select * from Emailid");

<table cellspacing="5" cellpadding="5" border="1">
<td align="right">First name:</td>
<td><%= firstName %></td>
<td align="right">Last name:</td>
<td><%= lastName %></td>
<td align="right">Email address:</td>
<td><%= emailAddress %></td>
<p>To enter another email address, click on the Back <br>
button in your browser or the Return button shown <br>
<form action="join_email_list.html" method="post">
<input type="submit" value="Return">


thnks in advance.....:)

9 Years
Discussion Span
Last Post by stephen84s

And what exactly would be the problem, other than the fact that this is JSP and should have been posted to the JSP Forum, and you are doing about every thing in a JSP that you shouldn't be.

  • No Code tags
  • All JDBC Code is directly in the JSP
  • JSPs are only supposed to display data processed by the Java Beans where your database connectivity and processing should take place
  • This is a Core-JAVA forum, There already is a JSP forum in the web development section.
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.