Advertisement
Guest User

Untitled

a guest
Aug 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Class.forName("oracle.jdbc.driver.OracleDriver");
  2. Connection con =
  3. DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe",
  4. "system", "9900479852");
  5. Statement stmt =con.createStatement();
  6. ResultSet rs = stmt.executeQuery("select *from registration where emailid='"+str+"' ");
  7.  
  8. // here im fetching the emailid from data base
  9. while(rs.next()){
  10.  
  11. emailId = rs.getString("emailId");
  12. mob = rs.getString("mobilenumber");
  13. System.out.println(emailId);
  14.  
  15. //here we return update query`enter code here`
  16. if(emailId.equals(str)){
  17. stmt.executeQuery("update registration set password='"+s1+"'
  18. where emailId='"+str+" '"); //query is executing but new vales are not updating to the data base
  19. p.println("updated");
  20. }
  21. con.close();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement