Advertisement
Guest User

Untitled

a guest
Dec 1st, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <%@ page contentType="text/html; charset=iso-8859-1" language="java"
  2.  
  3. import="java.sql.*" errorPage="" %>
  4. <html>
  5. <body>
  6. <%
  7. Class.forName("oracle.jdbc.driver.OracleDriver");
  8. String hostname = "172.16.60.13";
  9. int port = 1521;
  10. String sid = "orcl";
  11. String oracleURL = "jdbc:oracle:thin:@"+hostname+":"+port+":"+sid;
  12. String username = "E183383";
  13. String password = "183383";
  14. Connection conn = DriverManager.getConnection(oracleURL, username,
  15.  
  16. password);
  17. Statement stmt = conn.createStatement();
  18. String query = "Select user_id from lb_user where
  19.  
  20. user_id="+request.getParameter("user_id");
  21. ResultSet rs = stmt.executeQuery(query);
  22. boolean rs_isEmpty = !rs.next();
  23. boolean rs_hasData = !rs_isEmpty;
  24. Object rs_data;
  25. out.println(request.getParameter("user_id"));
  26. %>
  27. <%if (!rs.isBeforeFirst()){%>
  28. <script>alert("Your ID is not registered!");</script>
  29. <%
  30. }%>
  31. <%
  32. conn.close();
  33. %>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement