Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- try{
- HttpSession session=request.getSession();
- RequestDispatcher rd=null;
- Class.forName("oracle.jdbc.Driver.OracleDriver");
- Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","hr","Admin");
- String itemid=null;
- itemid=request.getParameter("id");
- Statement st=con.createStatement();
- ResultSet rs=st.executeQuery("select quantity from item where id='"+id+"'");
- int value;
- while(rs.next())
- {
- value=rs.getInt("quantity");
- if(value<4)
- { session.setattribute("itemid",id);
- rd.getRequestDisspatcher("FormDisplay.jsp")
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement