Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. //helping method for getDoctorFromDB
  2. public static void initialize (Connection conn) {
  3. try {
  4. Statement stmt = conn.createStatement();
  5. ResultSet rs = stmt.executeQuery("select name, password, phoneNumber, hospital, idDoctor from doctor where username="+ "\""+username+"\"");
  6. while (rs.next()) {
  7. idDoctor= rs.getInt("idDoctor");
  8. name = rs.getString("name");
  9. password = rs.getString("password");
  10. phoneNumber = rs.getInt("phoneNumber");
  11. hospital = rs.getString("hospital");
  12.  
  13. }
  14.  
  15. } catch (Exception e) {
  16. System.out.println("db error during select of doctor= "+e);
  17. return;
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement