tillu Sharma

Greenhorn
+ Follow
since Dec 07, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by tillu Sharma

thanks save file in database but how to download save in database file...what is the exact procedure....
yes, exception is occur in this program..........
13 years ago
dear friends,
i don't have remove class not find error......and servlet not inserted data in database............what kind of this problem ..friend solve this problem and give me suggestion...please

datatype in database is varchar2


Database class:

package work;
import java.sql.*;
public class Jdbc_Connection
{
public java.sql.Connection con=null;

public Connection getconnection()
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","password");
}
catch(Exception ex)
{
ex.printStackTrace();
return (null);
}
return con;
}



}





User_Servlet class:

package work;

import java.io.IOException;
import java.sql.*;
import java.sql.PreparedStatement;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class User_Servlet
*/
public class User_Servlet extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public User_Servlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
try
{
int i;
Jdbc_Connection JConnection =new Jdbc_Connection();
System.out.println("Hello");
//Statement stmt=null;
String firstName = request.getParameter("Firstname");
String lastName = request.getParameter("Lastname");
String email = request.getParameter("Email");
String confirmEmail = request.getParameter("Confirm_Email");
String password = request.getParameter("Password");
Connection con = JConnection.getconnection();
PreparedStatement ps=con.prepareStatement("insert into USER_INFO values(?,?,?,?)");
ps.setString(3, email);
ps.setString(1, firstName);
ps.setString(2, lastName);
ps.setString(4,password);
i = ps.executeUpdate();
System.out.print(i);
// System.out.println("This is the SErvlet"+firstName);
//response.sendRedirect("/pages/signin.html");
javax.servlet.RequestDispatcher rd = null;
rd = request.getRequestDispatcher("/pages/signin.html");
rd.forward(request, response);
// con.close();
}
catch(Exception e)
{
System.out.println("i m in servlet exception......");

}
}

}
13 years ago
Bear sir i don't have code...........can you give me code please



thank you
13 years ago
What is the best way to add a Calendar to my JSP
13 years ago
JSP