SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 a บทที่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 a บทที่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
 

Más de 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
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

บทที่4