+ 1
Capture user id
Hello, im making a web application with NetBeans and im trying to register the system logs into a database. But im not sucessful to get the user id after login. Could anyone help me?
1 Answer
0
try{Â Â
Class.forName("oracle.jdbc.drivser.OracleDriver");Â Â
Connection con=DriverManager.getConnection( Â
"jdbc:oracle:thin:@localhost:1521:xe","system","oracle");Â Â
     Â
PreparedStatement ps=con.prepareStatement( Â
"select * from userreg where name=? and pass=?"); Â
ps.setString(1,name);Â Â
ps.setString(2,pass);Â Â
     Â
ResultSet rs=ps.executeQuery(); Â
status=rs.next();Â Â
         Â
}catch(Exception e){System.out.println(e);} Â
return status; Â
}Â Â
}Â Â