Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Consultar Profesor
- @Override
- public Profesores consultarProfesores(String usuario, String password)
- {
- PreparedStatement pstm = null;
- ResultSet rs = null;
- Profesores profesores = null;
- try {
- String sql = "SELECT * FROM profesores WHERE lower(usuario) = ?";
- pstm = connection.prepareStatement(sql);
- pstm.setString(1, usuario);
- rs = pstm.executeQuery();
- if (rs.next()) {
- profesores = new Profesores(rs.getString("usuario"), rs.getString("password"), rs.getString("nombre"), rs.getString("apellidos"), rs.getString("nif"));
- profesores.setId(rs.getInt("id"));
- }
- } catch (SQLException e) {
- } finally {
- try {
- if (pstm != null) {
- pstm.close();
- }
- if (rs != null) {
- rs.close();
- }
- } catch (SQLException e) {
- }
- }
- return profesores;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement