+ 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 Respuesta
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;
}
}