Guest User

Untitled

a guest
Apr 1st, 2019
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. String sal="";
  2. if(request.getParameter("txt1")!=null)
  3. {
  4.  
  5. int n1=Integer.parseInt(request.getParameter("text1"));
  6.  
  7.  
  8.  
  9. try{
  10. Class.forName("com.mysql.jdbc.Driver");
  11.  
  12. Connection cnn=DriverManager.getConnection("jdbc:mysql://localhost/dbhp", "root", "");
  13.  
  14. Statement st=cnn.createStatement();
  15.  
  16. String str="Select * from emp where salary>"+ n1;
  17. ResultSet rs = st.executeQuery(str);
  18.  
  19.  
  20. }
  21. catch(Exception ex)
  22. {
  23.  
  24. }
  25. }
  26. >%String sal="";
  27. if(request.getParameter("txt1")!=null)
  28. {
  29.  
  30. int n1=Integer.parseInt(request.getParameter("text1"));
  31.  
  32.  
  33.  
  34. try{
  35. Class.forName("com.mysql.jdbc.Driver");
  36.  
  37. Connection cnn=DriverManager.getConnection("jdbc:mysql://localhost/dbhp", "root", "");
  38.  
  39. Statement st=cnn.createStatement();
  40.  
  41. String str="Select * from emp where salary>"+ n1;
  42. ResultSet rs = st.executeQuery(str);
  43.  
  44.  
  45. }
  46. catch(Exception ex)
  47. {
  48.  
  49. }
  50. }
  51. >%
Add Comment
Please, Sign In to add comment