SlideShare a Scribd company logo
1 of 37
JSP & SQL
Servlets
Servlets Component
request response
JSP
JavaBean
JavaBean java
code JSP
HTML code
JavaBean
-
Compile
- load
- Component
DAO (Data Access
Objects)DAO (Data Access Objects)
object-
oriented
programmer
database
Database
(Database (
File) Record)
Field)
electronic filing system
SQL
SQL
1. Select query
2 Update query
3 Insert query
4 Delete query
INSERT
INSERT INTO Tablename (column 1, column 2,…)
VALUES ( 'Value1', 'Value2', 'Value..n' )"
INSERT INTO
tablename
column 1
Value1
INSERT INTO Tablename (column 1, column 2,…)
VALUES ( 'Value1', 'Value2', 'Value..n' )"
Navicat
1. Connection
MyHost
New Database…
2. Database
cartoonbook Character
set utf8 – UTF-8 Unicode
Collation utf8_genral_ci
3.
Table New table
4.
5. Fields
member_id
 Type int
 Length
 Decimals
 Allow Null

6. Fields
7. Fields Save
8.
JSP SQL
Class Bean
1.
2. getters setters
source > Generate
Getters and Setters
3. Select All Generate
4. Generate
Class DAO
DataBase
1. class MemberDAO
2. addMembers
MemberDAO Insert
database
Code Servlet
1. Object mem Class
MembersBean
Class
MembersBean
2. Object memdao
Class MembersDAO
Class
MembersDAO
Servlet DBDAO
JSP
Browser
HTML
Object
ObjectRequest Result Set
Bean
บทที่4
บทที่4
บทที่4
บทที่4

More Related Content

What's hot

04 data accesstechnologies
04 data accesstechnologies04 data accesstechnologies
04 data accesstechnologies
Bat Programmer
 
Java căn bản - Chapter12
Java căn bản - Chapter12Java căn bản - Chapter12
Java căn bản - Chapter12
Vince Vo
 
4java Basic Syntax
4java Basic Syntax4java Basic Syntax
4java Basic Syntax
Adil Jafri
 
Android App Development 05 : Saving Data
Android App Development 05 : Saving DataAndroid App Development 05 : Saving Data
Android App Development 05 : Saving Data
Anuchit Chalothorn
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
Syed Shahul
 

What's hot (18)

04 data accesstechnologies
04 data accesstechnologies04 data accesstechnologies
04 data accesstechnologies
 
Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access
 
09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Android sq lite-chapter 22
Android sq lite-chapter 22Android sq lite-chapter 22
Android sq lite-chapter 22
 
Techniques for Cross Platform .NET Development
Techniques for Cross Platform .NET DevelopmentTechniques for Cross Platform .NET Development
Techniques for Cross Platform .NET Development
 
Java căn bản - Chapter12
Java căn bản - Chapter12Java căn bản - Chapter12
Java căn bản - Chapter12
 
Ado.net with asp.net
Ado.net with asp.netAdo.net with asp.net
Ado.net with asp.net
 
4java Basic Syntax
4java Basic Syntax4java Basic Syntax
4java Basic Syntax
 
Sql interview-book
Sql interview-bookSql interview-book
Sql interview-book
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Android App Development 05 : Saving Data
Android App Development 05 : Saving DataAndroid App Development 05 : Saving Data
Android App Development 05 : Saving Data
 
Jdbc
JdbcJdbc
Jdbc
 
Asegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingAsegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File Downloading
 
Ado.net
Ado.netAdo.net
Ado.net
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
 
JDBC - JPA - Spring Data
JDBC - JPA - Spring DataJDBC - JPA - Spring Data
JDBC - JPA - Spring Data
 

Viewers also liked

JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
Talha Ocakçı
 
STUDENT RECORD MANAGEMENT SYSTEM (1)
STUDENT RECORD MANAGEMENT SYSTEM (1)STUDENT RECORD MANAGEMENT SYSTEM (1)
STUDENT RECORD MANAGEMENT SYSTEM (1)
Juliet Nandutu
 
Student information-system-project-outline
Student information-system-project-outlineStudent information-system-project-outline
Student information-system-project-outline
Amit Panwar
 
Student management system
Student management systemStudent management system
Student management system
Gaurav Subham
 

Viewers also liked (6)

Web application using JSP
Web application using JSPWeb application using JSP
Web application using JSP
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
 
STUDENT RECORD MANAGEMENT SYSTEM (1)
STUDENT RECORD MANAGEMENT SYSTEM (1)STUDENT RECORD MANAGEMENT SYSTEM (1)
STUDENT RECORD MANAGEMENT SYSTEM (1)
 
student database management system
student database management systemstudent database management system
student database management system
 
Student information-system-project-outline
Student information-system-project-outlineStudent information-system-project-outline
Student information-system-project-outline
 
Student management system
Student management systemStudent management system
Student management system
 

Similar to บทที่4

4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL
4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL
4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL
squall1735
 
บท4
บท4บท4
บท4
bank_b
 
jdbc_presentation.ppt
jdbc_presentation.pptjdbc_presentation.ppt
jdbc_presentation.ppt
DrMeenakshiS
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
Maher Abdo
 
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
Ontico
 
JDBC JAVA DATABASE CONNECTIVITY AND JAVA
JDBC JAVA DATABASE CONNECTIVITY AND JAVAJDBC JAVA DATABASE CONNECTIVITY AND JAVA
JDBC JAVA DATABASE CONNECTIVITY AND JAVA
AdarshSrungarapu
 
บทที่6 update&delete
บทที่6 update&deleteบทที่6 update&delete
บทที่6 update&delete
Palm Unnop
 

Similar to บทที่4 (20)

4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL
4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL
4.เพิ่มข้อมูลลง DB ด้วย JSP&SQL
 
บท4
บท4บท4
บท4
 
บท4
บท4บท4
บท4
 
Jdbc 4.0 New Features And Enhancements
Jdbc 4.0 New Features And EnhancementsJdbc 4.0 New Features And Enhancements
Jdbc 4.0 New Features And Enhancements
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7
 
jdbc_presentation.ppt
jdbc_presentation.pptjdbc_presentation.ppt
jdbc_presentation.ppt
 
JDBC
JDBCJDBC
JDBC
 
OOP Lecture 18-DB Connectivity-Part2.pptx
OOP Lecture 18-DB Connectivity-Part2.pptxOOP Lecture 18-DB Connectivity-Part2.pptx
OOP Lecture 18-DB Connectivity-Part2.pptx
 
Update&delete
Update&deleteUpdate&delete
Update&delete
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web apps
 
Java
JavaJava
Java
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
NoSQL Best Practices for PostgreSQL / Дмитрий Долгов (Mindojo)
 
Lecture17
Lecture17Lecture17
Lecture17
 
Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010
 
JDBC JAVA DATABASE CONNECTIVITY AND JAVA
JDBC JAVA DATABASE CONNECTIVITY AND JAVAJDBC JAVA DATABASE CONNECTIVITY AND JAVA
JDBC JAVA DATABASE CONNECTIVITY AND JAVA
 
บทที่6 update&delete
บทที่6 update&deleteบทที่6 update&delete
บทที่6 update&delete
 
Android database tutorial
Android database tutorialAndroid database tutorial
Android database tutorial
 
Let's talk about java class file
Let's talk about java class fileLet's talk about java class file
Let's talk about java class file
 

More from Waritsara Sonchan (9)

บทที่ 8
บทที่ 8บทที่ 8
บทที่ 8
 
บทที่ 9
บทที่ 9บทที่ 9
บทที่ 9
 
บทที่ 7
บทที่ 7บทที่ 7
บทที่ 7
 
บทที่ 7
บทที่ 7บทที่ 7
บทที่ 7
 
บทที่6
บทที่6บทที่6
บทที่6
 
บทที่5
บทที่5บทที่5
บทที่5
 
บทที่3
บทที่3บทที่3
บทที่3
 
บทที่2
บทที่2บทที่2
บทที่2
 
บทที่1
บทที่1บทที่1
บทที่1
 

Recently uploaded

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 

บทที่4