Guest User

Untitled

a guest
Dec 19th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <%
  2. session.getAttribute("id");
  3. String str = session.getAttribute("id").toString();
  4. String div = request.getParameter("div");
  5.  
  6. Class.forName("oracle.jdbc.driver.OracleDriver");
  7.  
  8. Connection conn = null;
  9. PreparedStatement pstmt = null;
  10.  
  11.  
  12.  
  13. try{
  14. String jdbcDriver = "jdbc:oracle:thin:@localhost:1521:xe";
  15. String dbUser = "scott";
  16. String dbPass = "1111";
  17.  
  18. conn = DriverManager.getConnection(jdbcDriver,dbUser,dbPass);
  19. pstmt = conn.prepareStatement(
  20. "insert into NEW_MEMBER(BASKET) values(?) where id = str ");
  21.  
  22. pstmt.setString(1, div);
  23.  
  24.  
  25. pstmt.executeUpdate();
  26.  
  27.  
  28. }finally{
  29. if(pstmt!=null)try{pstmt.close();}catch(SQLException ex){}
  30. if(conn!=null)try{conn.close();}catch(SQLException ex){}
  31. }
  32.  
  33. %>
Add Comment
Please, Sign In to add comment