<div style='background-color: none transparent;'></div>
Home » » online banking system java file - class ADetail

online banking system java file - class ADetail

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;

public class logincheck1 extends HttpServlet{
Connection con;
Statement st;
ResultSet rs;

public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:bank");
st=con.createStatement();

int rano=Integer.parseInt(req.getParameter("accno"));
String ruid=req.getParameter("usrid");
String rupwd=req.getParameter("pswrd");

rs=st.executeQuery("SELECT * FROM USERTAB WHERE ACCOUNTNO="+rano+" AND USERID=\'"+ruid+"\' AND USERPWD=\'"+rupwd+"\'");
if (rs.next()){
res.setContentType("text/html");
PrintWriter out=res.getWriter();

String lname=rs.getString("lastname");
String fname=rs.getString("firstname");

out.println("Welcome Page");
out.println("

");
out.println("Welcome");
out.println(fname+" "+lname);
out.println("

");
out.println("");
out.println("Thank you for banking with us.

");
out.println("

Remember your Account No, User ID and Password.");
out.println("

");
out.println("

Your Account Number is :");
out.println(" ");
out.println(rano);
out.println("

");
out.println("

Your User ID is ");
out.println(" : ");
out.println(ruid);
out.println("

");
out.println("

Please click below to proceed

");
out.println("

");
out.println("Consumer Banking

");
}
else
res.sendRedirect("http:\\\\localhost:8080\\examples\\servlets\\login1.html");
}
catch(SQLException sqle4){
System.out.println("Sql Exception "+sqle4); }

catch(ClassNotFoundException cnfe){
System.out.println("Class Not Found "+cnfe);
}
}//END OF doPost
}

Share this article :
 
Copyright © 2011. B.Sc B.Tech MCA Ploytechnic Mini,Main Projects | Free Main Projcets Download | MCA |B.tech . All Rights Reserved
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Template Modify by Creating Website. Inpire by Darkmatter Rockettheme Proudly powered by Blogger