Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class.forName("oracle.jdbc.driver.OracleDriver");
- Connection con = DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:XE" , "system" , "connect" );
- String userName = request.getParameter("userName");
- String password = request.getParameter("password");
- PreparedStatement ps = con.prepareStatement("select * from table where username ="+userName+"and password ="+password);
- ResultSet rs = ps.executeQuery();
- if(rs.next())
- {
- System.out.println("account exists");
- ServletContext ctx = getServletContext();
- }
Add Comment
Please, Sign In to add comment