
Username,Password,
,
• action
servlet
 Servlet
NewFile2.jsp
SQL)
SQL)
SQL
Select query
Update query
Insert query
Delete query
JSP Servlets and Database
Dynamic Web Project Servlet " DataServlet.ja
public class controller {
DBconnect db = new DBconnect();
Statement stmt;
ResultSet rs = null;
public int insert(String sq...
UserDAO Mysql
display
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Presentation cs313 (1)
Upcoming SlideShare
Loading in …5
×

Presentation cs313 (1)

224 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
224
On SlideShare
0
From Embeds
0
Number of Embeds
48
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Presentation cs313 (1)

  1. 1.  Username,Password, ,
  2. 2. • action servlet
  3. 3.  Servlet NewFile2.jsp
  4. 4. SQL) SQL) SQL Select query Update query Insert query Delete query
  5. 5. JSP Servlets and Database
  6. 6. Dynamic Web Project Servlet " DataServlet.ja
  7. 7. public class controller { DBconnect db = new DBconnect(); Statement stmt; ResultSet rs = null; public int insert(String sql) { try { db.createConnection(); stmt = db.getStatement(); stmt.executeUpdate(sql); } catch (SQLException ex) { Logger.getLogger(controller.class.getName()).log(Level.SEVERE,null, ex); return 0; } db.closeConnection(); return 1; }
  8. 8. UserDAO Mysql
  9. 9. display

×