Advertisement
Guest User

Untitled

a guest
Feb 14th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public static void main(String [] args) {
  2.  
  3.  
  4. try {
  5.  
  6. Class.forName("oracle.jdbc.driver.OracleDriver");
  7. Connection con = DriverManager.getConnection("jdbc:oracle:thin:user/pass@host:1522/base");
  8. Statement stmt = con.createStatement();
  9.  
  10. String sql ="Select * from acesso where nrdocumento ='999999999999'";
  11.  
  12. ResultSet res = stmt.executeQuery(sql);
  13.  
  14. while (res.next()); {
  15. String hash = res.getString(3);
  16. System.out.println(hash);
  17.  
  18.  
  19. }
  20.  
  21. con.close();
  22. }
  23.  
  24. catch (Exception e ) {
  25. e.printStackTrace();
  26. }
  27. }
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement