Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page contentType="text/html; charset=iso-8859-1" language="java"
- import="java.sql.*" errorPage="" %>
- <html>
- <body>
- <%
- Class.forName("oracle.jdbc.driver.OracleDriver");
- String hostname = "172.16.60.13";
- int port = 1521;
- String sid = "orcl";
- String oracleURL = "jdbc:oracle:thin:@"+hostname+":"+port+":"+sid;
- String username = "E183383";
- String password = "183383";
- Connection conn = DriverManager.getConnection(oracleURL, username,
- password);
- Statement stmt = conn.createStatement();
- String query = "Select user_id from lb_user where
- user_id="+request.getParameter("user_id");
- ResultSet rs = stmt.executeQuery(query);
- boolean rs_isEmpty = !rs.next();
- boolean rs_hasData = !rs_isEmpty;
- Object rs_data;
- out.println(request.getParameter("user_id"));
- %>
- <%if (!rs.isBeforeFirst()){%>
- <script>alert("Your ID is not registered!");</script>
- <%
- }%>
- <%
- conn.close();
- %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement