SlideShare a Scribd company logo
1 of 19
JDBC :- is used for accessing databases from
Java applications
A Java API for executing SQL statements
• Extends the Java language.
• Supported by the java.sql package
• uniform interface to different data sources so
programmer writes ONE database interface; using
JDBC, program can access any data
source without recoding
 Open Database Connectivity developed by Microsoft
to provide interaction with databases using SQL.
 Use the JDBC-ODBC bridge to make ODBC work with
Java.
Since it's going to take some time for vendors to create
JDBC drivers, Javasoft has released a JDBC-ODBC
bridge that allows you to create Java applications to
talk to ODBC drivers which are readily available today
6
JDBC Architecture (cont.)
Application JDBC Driver
• Java code calls JDBC library
• JDBC loads a driver
• Driver talks to a particular database
• An application can work with several databases by
using all corresponding drivers
7
• Load the driver
• Define the connection URL
• Establish the connection
• Create a Statement object
• Execute a query using the Statement
Driver Manager - loads the database drivers, and manages
the connection between the application and the driver.
Driver - translates API calls into operations for a specific data
source.
Connection - A session between an application and a
database.
Statement - An SQL statement to perform.
PreparedStatement - a precompiled and stored query.
ResultSet - logical set of data returned by executing a
statement.
MetaData - Information about the returned data (resultset)
including the attribute names and types.
Class.forName("oracle.jdbc.OracleDriver");
Load a Given Class Name in Main Memory
 Connection cn;
 DriverManager.getConnection(URL, user, pwd);
cn=DriverManager.getConnection("jdbc:oracle:thin:@loca
lhost:1521:SHIKO", "bank", "bank");
 We use Statement objects in order to
 Query the database
 Update the database
 They are created by the Connection
Statement st=cn.createStatement();
rs pointer pointing to the before first
rs=st.executeQuery("Select * from Categories");
C . R . U . D
Up Date
JDBC Reference
ResultSet
- Provides access to records resulting from a query.
METHODS:
public void afterLast () throws SQLException
- moves the cursor to the end of the result set.
public void beforeFirst () throws SQLException
- moves the cursor to the beginning of the resultset.
public void cancelRowUpdates () throws SQLException
- cancels any updates made to this row.
public void close() throws SQLException
- closes the resultset.
public void deleteRow () throws SQLException
- deletes the current row from the resultset and the database.
public void first () throws SQLException
- moves the cursor to the first row of the resultset.
public void last () throws SQLException
- moves the cursor to the last row of the resultset.
JDBC Reference
ResultSet
METHODS:
public boolean getBoolean (String cname) throws SQLException
- returns the value of the named column(cname) in Boolean format.
public Date getDate (String cname) throws SQLException
- returns the value of the named column(cname) in Date format.
public double getDouble (String cname) throws SQLException
- returns the value of the named column(cname) in Double format.
public float getFloat (String cname) throws SQLException
- returns the value of the named column(cname) in Float format.
public int getInt (String cname) throws SQLException
- returns the value of the named column(cname) in Int format.
public String getString (String cname) throws SQLException
- returns the value of the named column(cname) in String format.
public ResultSetMetaData getMetaData ( ) throws SQLException
- returns the meta-data object for this resultset.
public void insertRow ( ) throws SQLException
- inserts the contents of the insert row into the result set and database.
JDBC

More Related Content

What's hot

Java database connectivity
Java database connectivityJava database connectivity
Java database connectivityAtul Saurabh
 
1. java database connectivity (jdbc)
1. java database connectivity (jdbc)1. java database connectivity (jdbc)
1. java database connectivity (jdbc)Fad Zulkifli
 
3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asksPramod Singla
 
Java database connectivity with MySql
Java database connectivity with MySqlJava database connectivity with MySql
Java database connectivity with MySqlDhyey Dattani
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)Maher Abdo
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database ConnectivityRanjan Kumar
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Pooja Talreja
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivityVaishali Modi
 
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow TasksPramod Singla
 
Jdbc slide for beginers
Jdbc slide for beginersJdbc slide for beginers
Jdbc slide for beginersAmbarish Rai
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySqlkamal kotecha
 

What's hot (19)

Jdbc connectivity in java
Jdbc connectivity in javaJdbc connectivity in java
Jdbc connectivity in java
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
1. java database connectivity (jdbc)
1. java database connectivity (jdbc)1. java database connectivity (jdbc)
1. java database connectivity (jdbc)
 
Jdbc
JdbcJdbc
Jdbc
 
3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks
 
Java database connectivity with MySql
Java database connectivity with MySqlJava database connectivity with MySql
Java database connectivity with MySql
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database Connectivity
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Jdbc
JdbcJdbc
Jdbc
 
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
 
java jdbc connection
java jdbc connectionjava jdbc connection
java jdbc connection
 
Jdbc slide for beginers
Jdbc slide for beginersJdbc slide for beginers
Jdbc slide for beginers
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Overview Of JDBC
Overview Of JDBCOverview Of JDBC
Overview Of JDBC
 
Lecture 1. java database connectivity
Lecture 1. java database connectivityLecture 1. java database connectivity
Lecture 1. java database connectivity
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
 

Viewers also liked

Photo Essay Zhao
Photo Essay ZhaoPhoto Essay Zhao
Photo Essay ZhaomLong99
 
Dana wangrakyat
Dana wangrakyatDana wangrakyat
Dana wangrakyatNorawati
 
RadiciGroup for sustainability 2013 - Italiano
RadiciGroup for sustainability 2013 - ItalianoRadiciGroup for sustainability 2013 - Italiano
RadiciGroup for sustainability 2013 - ItalianoRadiciGroup
 
Advances in Innovation
Advances in InnovationAdvances in Innovation
Advances in InnovationRadiciGroup
 
Dennis ridho a d1511026
Dennis ridho a d1511026Dennis ridho a d1511026
Dennis ridho a d1511026sitisepty
 
Petrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkel
Petrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkelPetrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkel
Petrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkelAgroinform.com
 
Comenius Hiszpania 2013 by Aleksandra Rusinowska
Comenius   Hiszpania 2013 by Aleksandra RusinowskaComenius   Hiszpania 2013 by Aleksandra Rusinowska
Comenius Hiszpania 2013 by Aleksandra RusinowskaAnna Górka
 
RADILON® XTreme
RADILON® XTremeRADILON® XTreme
RADILON® XTremeRadiciGroup
 
PET NARRATOR
PET NARRATORPET NARRATOR
PET NARRATORpigson
 
International Business Management - Lecture No 05
International Business Management - Lecture No 05International Business Management - Lecture No 05
International Business Management - Lecture No 05Khurshid Swati
 
World isflatsummary
World isflatsummaryWorld isflatsummary
World isflatsummaryBASANTY
 
RadiciPlastics Corporate presentation
RadiciPlastics Corporate presentationRadiciPlastics Corporate presentation
RadiciPlastics Corporate presentationRadiciGroup
 
Contents page analysis
Contents page analysisContents page analysis
Contents page analysisNyashaPindai
 
Materiali speciali e approccio progettuale per un design innovativo: un binom...
Materiali speciali e approccio progettuale per un design innovativo: un binom...Materiali speciali e approccio progettuale per un design innovativo: un binom...
Materiali speciali e approccio progettuale per un design innovativo: un binom...RadiciGroup
 
Blue Economy: dagli scenari globali alle opportunità per le imprese
Blue Economy: dagli scenari globali alle opportunità per le impreseBlue Economy: dagli scenari globali alle opportunità per le imprese
Blue Economy: dagli scenari globali alle opportunità per le impreseRadiciGroup
 

Viewers also liked (20)

Photo Essay Zhao
Photo Essay ZhaoPhoto Essay Zhao
Photo Essay Zhao
 
Poland
PolandPoland
Poland
 
Dana wangrakyat
Dana wangrakyatDana wangrakyat
Dana wangrakyat
 
บทสวด
บทสวดบทสวด
บทสวด
 
Agroinform news
Agroinform newsAgroinform news
Agroinform news
 
RadiciGroup for sustainability 2013 - Italiano
RadiciGroup for sustainability 2013 - ItalianoRadiciGroup for sustainability 2013 - Italiano
RadiciGroup for sustainability 2013 - Italiano
 
Case Study | EdisonWeb
Case Study | EdisonWebCase Study | EdisonWeb
Case Study | EdisonWeb
 
Advances in Innovation
Advances in InnovationAdvances in Innovation
Advances in Innovation
 
Dennis ridho a d1511026
Dennis ridho a d1511026Dennis ridho a d1511026
Dennis ridho a d1511026
 
Petrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkel
Petrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkelPetrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkel
Petrik Máté - Kis- és középgazdaságok irányítása informatikai eszközökkel
 
Comenius Hiszpania 2013 by Aleksandra Rusinowska
Comenius   Hiszpania 2013 by Aleksandra RusinowskaComenius   Hiszpania 2013 by Aleksandra Rusinowska
Comenius Hiszpania 2013 by Aleksandra Rusinowska
 
RADILON® XTreme
RADILON® XTremeRADILON® XTreme
RADILON® XTreme
 
PET NARRATOR
PET NARRATORPET NARRATOR
PET NARRATOR
 
SWMA 4 - Cookin tuk
SWMA 4 - Cookin tukSWMA 4 - Cookin tuk
SWMA 4 - Cookin tuk
 
International Business Management - Lecture No 05
International Business Management - Lecture No 05International Business Management - Lecture No 05
International Business Management - Lecture No 05
 
World isflatsummary
World isflatsummaryWorld isflatsummary
World isflatsummary
 
RadiciPlastics Corporate presentation
RadiciPlastics Corporate presentationRadiciPlastics Corporate presentation
RadiciPlastics Corporate presentation
 
Contents page analysis
Contents page analysisContents page analysis
Contents page analysis
 
Materiali speciali e approccio progettuale per un design innovativo: un binom...
Materiali speciali e approccio progettuale per un design innovativo: un binom...Materiali speciali e approccio progettuale per un design innovativo: un binom...
Materiali speciali e approccio progettuale per un design innovativo: un binom...
 
Blue Economy: dagli scenari globali alle opportunità per le imprese
Blue Economy: dagli scenari globali alle opportunità per le impreseBlue Economy: dagli scenari globali alle opportunità per le imprese
Blue Economy: dagli scenari globali alle opportunità per le imprese
 

Similar to JDBC

Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Luzan Baral
 
Jdbc connectivity
Jdbc connectivityJdbc connectivity
Jdbc connectivityarikazukito
 
JDBC java for learning java for learn.ppt
JDBC java for learning java for learn.pptJDBC java for learning java for learn.ppt
JDBC java for learning java for learn.pptkingkolju
 
Introduction to JDBC and database access in web applications
Introduction to JDBC and database access in web applicationsIntroduction to JDBC and database access in web applications
Introduction to JDBC and database access in web applicationsFulvio Corno
 
Database connect
Database connectDatabase connect
Database connectYoga Raja
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivityVaishali Modi
 
Advance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-databaseAdvance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-databasePayal Dungarwal
 
4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.pptNaveenKumar648465
 
Advance Java Practical file
Advance Java Practical fileAdvance Java Practical file
Advance Java Practical filevarun arora
 

Similar to JDBC (20)

Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
 
Jdbc connectivity
Jdbc connectivityJdbc connectivity
Jdbc connectivity
 
Jdbc[1]
Jdbc[1]Jdbc[1]
Jdbc[1]
 
JDBC programming
JDBC programmingJDBC programming
JDBC programming
 
JDBC
JDBCJDBC
JDBC
 
JDBC java for learning java for learn.ppt
JDBC java for learning java for learn.pptJDBC java for learning java for learn.ppt
JDBC java for learning java for learn.ppt
 
Introduction to JDBC and database access in web applications
Introduction to JDBC and database access in web applicationsIntroduction to JDBC and database access in web applications
Introduction to JDBC and database access in web applications
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Database connect
Database connectDatabase connect
Database connect
 
Jdbc
JdbcJdbc
Jdbc
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
 
Jdbc api
Jdbc apiJdbc api
Jdbc api
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Advance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-databaseAdvance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-database
 
4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt
 
Jdbc introduction
Jdbc introductionJdbc introduction
Jdbc introduction
 
Advance Java Practical file
Advance Java Practical fileAdvance Java Practical file
Advance Java Practical file
 
Java jdbc
Java jdbcJava jdbc
Java jdbc
 
Jdbc new
Jdbc newJdbc new
Jdbc new
 

Recently uploaded

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 

Recently uploaded (20)

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 

JDBC

  • 1.
  • 2. JDBC :- is used for accessing databases from Java applications A Java API for executing SQL statements • Extends the Java language. • Supported by the java.sql package • uniform interface to different data sources so programmer writes ONE database interface; using JDBC, program can access any data source without recoding
  • 3.
  • 4.  Open Database Connectivity developed by Microsoft to provide interaction with databases using SQL.  Use the JDBC-ODBC bridge to make ODBC work with Java. Since it's going to take some time for vendors to create JDBC drivers, Javasoft has released a JDBC-ODBC bridge that allows you to create Java applications to talk to ODBC drivers which are readily available today
  • 5.
  • 6. 6 JDBC Architecture (cont.) Application JDBC Driver • Java code calls JDBC library • JDBC loads a driver • Driver talks to a particular database • An application can work with several databases by using all corresponding drivers
  • 7. 7 • Load the driver • Define the connection URL • Establish the connection • Create a Statement object • Execute a query using the Statement
  • 8. Driver Manager - loads the database drivers, and manages the connection between the application and the driver. Driver - translates API calls into operations for a specific data source. Connection - A session between an application and a database. Statement - An SQL statement to perform. PreparedStatement - a precompiled and stored query. ResultSet - logical set of data returned by executing a statement. MetaData - Information about the returned data (resultset) including the attribute names and types.
  • 10.  Connection cn;  DriverManager.getConnection(URL, user, pwd); cn=DriverManager.getConnection("jdbc:oracle:thin:@loca lhost:1521:SHIKO", "bank", "bank");
  • 11.  We use Statement objects in order to  Query the database  Update the database  They are created by the Connection Statement st=cn.createStatement();
  • 12. rs pointer pointing to the before first rs=st.executeQuery("Select * from Categories");
  • 13.
  • 14.
  • 15. C . R . U . D Up Date
  • 16.
  • 17. JDBC Reference ResultSet - Provides access to records resulting from a query. METHODS: public void afterLast () throws SQLException - moves the cursor to the end of the result set. public void beforeFirst () throws SQLException - moves the cursor to the beginning of the resultset. public void cancelRowUpdates () throws SQLException - cancels any updates made to this row. public void close() throws SQLException - closes the resultset. public void deleteRow () throws SQLException - deletes the current row from the resultset and the database. public void first () throws SQLException - moves the cursor to the first row of the resultset. public void last () throws SQLException - moves the cursor to the last row of the resultset.
  • 18. JDBC Reference ResultSet METHODS: public boolean getBoolean (String cname) throws SQLException - returns the value of the named column(cname) in Boolean format. public Date getDate (String cname) throws SQLException - returns the value of the named column(cname) in Date format. public double getDouble (String cname) throws SQLException - returns the value of the named column(cname) in Double format. public float getFloat (String cname) throws SQLException - returns the value of the named column(cname) in Float format. public int getInt (String cname) throws SQLException - returns the value of the named column(cname) in Int format. public String getString (String cname) throws SQLException - returns the value of the named column(cname) in String format. public ResultSetMetaData getMetaData ( ) throws SQLException - returns the meta-data object for this resultset. public void insertRow ( ) throws SQLException - inserts the contents of the insert row into the result set and database.

Editor's Notes

  1. $hiko
  2. $hiko
  3. $hiko
  4. $hiko
  5. $hiko
  6. $hiko
  7. $hiko
  8. $hiko
  9. $hiko
  10. $hiko
  11. $hiko
  12. $hiko
  13. $hiko
  14. $hiko
  15. $hiko
  16. $hiko
  17. $hiko