SlideShare a Scribd company logo
JDBC
       Session 2




             tnngo2@gmail.com
Stored Procedure

     can be defined as a group of SQL statements performing
     a particular task

     used to group or batch a set of operations or queries to
     be executed on a database server

     Faster, more efficient than individual SQL query stmt
Characteristics of Stored Procedure

       contain SQL statements using constructs and control
structures

       be invoked by name in a application

       allow an application program to run in two parts such as
the application on the client and the stored procedure on the
server
Characteristics of Stored Procedure
Benefits of Stored Procedure

     Reduced network traffic

     Enhanced hardware and software capabilities
             Distributed computing
     Increased security
            Client need not have the privilege as DBA
     Decrease in development cost
             Reusing a common stored procedure
     Centralized control
            Security, administrator and maintenance in one
            place at the server
Create stored procedure using Statement obj
     Step 1:
Create stored procedure using Statement obj
     Step 2:
Parameters of a stored procedure
     Stored procedures can accept data in the form of input
     parameters that are specified at execution time

     There are three parameters
            IN
                cannot changed or reassigned within module
                 is constant
            OUT

            IN/OUT
Creating and executed
     CallableStatement does not contain the stored procedure
     itself only a call to it.

     CallableStatement cst =
            cn.preparedCall(“{call functioname(?,?)}”)
ResultSet

     A default result set object cannot be updated or scrolled
     backward and forward. By default the cursor moves
     forward only.

     The characteristics of ResultSet are
            Scrollable
            Updatable
            Holdable
                    Check whether the cursor stays open after
                    a commit
Scrollable ResultSet

allows the cursor to be moved to any row in the result set.
Scrollable ResultSet

allows the cursor to be moved to any row in the result set.
ResultSet constant values
     TYPE_FORWARD_ONLY
     TYPE_SCROLL_INSENSITIVE
     TYPE_SCROLL_SENSITIVE
Row Positioning Methods
     method of ResultSet
Row Positioning Methods
     method of ResultSet interface
Updatable “ResultSet”

     update rows in a result set using JAVA code rather than
           SQL commands.

     update, insert, delete
Concurrency

     Updatability require database write locks to provide
     access to the underlying database. Because you cannot
     have multiple write locks concurrently

     Updatability in a result set is associated with
     concurrency in database access.

     Concurrency is a process wherein two events take place
     in parallel

     Two types:
            CONCURRENCY.READ_ONLY
                 Result set cannot be modified
            CONCURRENCY.UPDATABLE
                 Update, insert and delete can performed
Batch Update

     can be defined as a set of multiple update statements
     that is submitted to the database for processing as a
     batch

     Statement, PreparedStatement, CallableStatement obj
     can be used to submit batch updates
Batch Update

Benefits:
       allow to request records, bring them to the client, make
       changes to the records on the client side, and then send
       the updated record back to the data source at some
       other time.

       improve performance

       no need to maintain a constant connection to the
       database
Batch Update using “Statement ” interface

     Disable the auto-commit mode
     Create a Statement instance
     Add SQL commands to the batch
     Execute the batch commands
     Commit the changes in the database
     Remove the commands from the batch
Batch Update using “Statement ” interface
Batch Update using “Statement ” interface
Batch Update using “Statement ” interface
Batch Update using “PreparedStatement” interface
Batch Update using “CallableStatement” interface
Transactions

     is a set of one or more statements that are executed
     together as a unit

     Ensures either all the statements in the set or none of
     them are executed

     bank funds tranfer
            withdraw from one : completed
            deposit to another: not
            => Fail
Properties of Transactions

      Atomicity
              all or none performed
      Consistency
              cannot break the rules such
              as integrity constraints
      Isolation
              no conflicts between
              concurrent transaction
      Durability
              recover committed transaction if needed
Implementing Transaction using JDBC
Implementing Transaction using JDBC
Implementing Transaction using JDBC

More Related Content

What's hot

Mule Ajax Connector
Mule Ajax ConnectorMule Ajax Connector
Mule Ajax Connector
Ankush Sharma
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformation
Son Nguyen
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
kunal vishe
 
Mule JMS transport
Mule JMS transportMule JMS transport
Mule JMS transport
Ankush Sharma
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
Ankush Sharma
 
Mule esb introduction
Mule esb introductionMule esb introduction
Mule esb introduction
Praneethchampion
 
Mule scopes request_response_scope
Mule scopes request_response_scopeMule scopes request_response_scope
Mule scopes request_response_scope
kunal vishe
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-Presentation
Chuck Walker
 
Mule Custom Aggregator
Mule Custom AggregatorMule Custom Aggregator
Mule Custom Aggregator
Ankush Sharma
 
Mule: Java Transformer
Mule: Java TransformerMule: Java Transformer
Mule: Java Transformer
Sulthony Hartanto
 
Mule advanced
Mule advancedMule advanced
Mule advanced
D.Rajesh Kumar
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
Ankush Sharma
 
Mule jms
Mule   jmsMule   jms
Opendaylight overview
Opendaylight overviewOpendaylight overview
Opendaylight overview
Prateek Baharani
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
javeed_mhd
 
Mule Collection Splitter
Mule Collection SplitterMule Collection Splitter
Mule Collection Splitter
Ankush Sharma
 
Mule generic connector
Mule generic connectorMule generic connector
Mule generic connector
Ankush Sharma
 
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
Pramod Singla
 
Mule batch
Mule batchMule batch
Mule batch
Gandham38
 
Mule properties
Mule propertiesMule properties
Mule properties
Gandham38
 

What's hot (20)

Mule Ajax Connector
Mule Ajax ConnectorMule Ajax Connector
Mule Ajax Connector
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformation
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
 
Mule JMS transport
Mule JMS transportMule JMS transport
Mule JMS transport
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
 
Mule esb introduction
Mule esb introductionMule esb introduction
Mule esb introduction
 
Mule scopes request_response_scope
Mule scopes request_response_scopeMule scopes request_response_scope
Mule scopes request_response_scope
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-Presentation
 
Mule Custom Aggregator
Mule Custom AggregatorMule Custom Aggregator
Mule Custom Aggregator
 
Mule: Java Transformer
Mule: Java TransformerMule: Java Transformer
Mule: Java Transformer
 
Mule advanced
Mule advancedMule advanced
Mule advanced
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
 
Mule jms
Mule   jmsMule   jms
Mule jms
 
Opendaylight overview
Opendaylight overviewOpendaylight overview
Opendaylight overview
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Mule Collection Splitter
Mule Collection SplitterMule Collection Splitter
Mule Collection Splitter
 
Mule generic connector
Mule generic connectorMule generic connector
Mule generic connector
 
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
 
Mule batch
Mule batchMule batch
Mule batch
 
Mule properties
Mule propertiesMule properties
Mule properties
 

Viewers also liked

Tervela Streaming for Web & Mobile
Tervela Streaming for Web & MobileTervela Streaming for Web & Mobile
Tervela Streaming for Web & Mobile
tervela
 
Long Lasting Memories Project Presentation
Long Lasting Memories Project PresentationLong Lasting Memories Project Presentation
Long Lasting Memories Project Presentation
Ilias Trochidis
 
Jdbc connectivity
Jdbc connectivityJdbc connectivity
Jdbc connectivity
arikazukito
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
Niit Care
 
Java session16
Java session16Java session16
Java session16
Niit Care
 
Interface result set
Interface result setInterface result set
Interface result set
myrajendra
 
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
DataStax Academy
 
Jdbc session01
Jdbc session01Jdbc session01
Jdbc session01
Niit Care
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
Dharani Kumar Madduri
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
Vikas Jagtap
 
JDBC Tutorial
JDBC TutorialJDBC Tutorial
JDBC Tutorial
Information Technology
 
Datafesta 20141004_05
Datafesta 20141004_05Datafesta 20141004_05
Datafesta 20141004_05
博三 太田
 
Don't be an altruistic angel. Be open about what is in it for you.
Don't be an altruistic angel.  Be open about what is in it for you.Don't be an altruistic angel.  Be open about what is in it for you.
Don't be an altruistic angel. Be open about what is in it for you.
Wayne Dunn
 
Программа здоровье опорно двигательного аппарата
Программа здоровье опорно двигательного аппарата Программа здоровье опорно двигательного аппарата
Программа здоровье опорно двигательного аппарата
Елена Шальнова
 
如何掌控自己的时间和生活(完整版)By louiechot
如何掌控自己的时间和生活(完整版)By louiechot如何掌控自己的时间和生活(完整版)By louiechot
如何掌控自己的时间和生活(完整版)By louiechot
liaohuanzhuo
 
Class 1
Class 1Class 1
Class 1
Les Davy
 
Inanimate Alice episode 5 by Ian and Henry
Inanimate Alice episode 5 by Ian and Henry Inanimate Alice episode 5 by Ian and Henry
Inanimate Alice episode 5 by Ian and Henry
MrsPrentice
 
slope and one point
slope and one pointslope and one point
slope and one point
candice santiago
 
De Wijkonderneming Terugblik En Resultatenoverzicht 2010.
De Wijkonderneming Terugblik En Resultatenoverzicht 2010.De Wijkonderneming Terugblik En Resultatenoverzicht 2010.
De Wijkonderneming Terugblik En Resultatenoverzicht 2010.Mieke Sanden, van der
 
Pantheon basics
Pantheon basicsPantheon basics
Pantheon basics
Plasterdog Web Design
 

Viewers also liked (20)

Tervela Streaming for Web & Mobile
Tervela Streaming for Web & MobileTervela Streaming for Web & Mobile
Tervela Streaming for Web & Mobile
 
Long Lasting Memories Project Presentation
Long Lasting Memories Project PresentationLong Lasting Memories Project Presentation
Long Lasting Memories Project Presentation
 
Jdbc connectivity
Jdbc connectivityJdbc connectivity
Jdbc connectivity
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Java session16
Java session16Java session16
Java session16
 
Interface result set
Interface result setInterface result set
Interface result set
 
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
Cassandra Summit 2014: Lesser Known Features of Cassandra 2.1
 
Jdbc session01
Jdbc session01Jdbc session01
Jdbc session01
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
JDBC Tutorial
JDBC TutorialJDBC Tutorial
JDBC Tutorial
 
Datafesta 20141004_05
Datafesta 20141004_05Datafesta 20141004_05
Datafesta 20141004_05
 
Don't be an altruistic angel. Be open about what is in it for you.
Don't be an altruistic angel.  Be open about what is in it for you.Don't be an altruistic angel.  Be open about what is in it for you.
Don't be an altruistic angel. Be open about what is in it for you.
 
Программа здоровье опорно двигательного аппарата
Программа здоровье опорно двигательного аппарата Программа здоровье опорно двигательного аппарата
Программа здоровье опорно двигательного аппарата
 
如何掌控自己的时间和生活(完整版)By louiechot
如何掌控自己的时间和生活(完整版)By louiechot如何掌控自己的时间和生活(完整版)By louiechot
如何掌控自己的时间和生活(完整版)By louiechot
 
Class 1
Class 1Class 1
Class 1
 
Inanimate Alice episode 5 by Ian and Henry
Inanimate Alice episode 5 by Ian and Henry Inanimate Alice episode 5 by Ian and Henry
Inanimate Alice episode 5 by Ian and Henry
 
slope and one point
slope and one pointslope and one point
slope and one point
 
De Wijkonderneming Terugblik En Resultatenoverzicht 2010.
De Wijkonderneming Terugblik En Resultatenoverzicht 2010.De Wijkonderneming Terugblik En Resultatenoverzicht 2010.
De Wijkonderneming Terugblik En Resultatenoverzicht 2010.
 
Pantheon basics
Pantheon basicsPantheon basics
Pantheon basics
 

Similar to Jdbc 2

Chapter09
Chapter09Chapter09
Chapter09
sasa_eldoby
 
Modernizing SQL Server the Right Way
Modernizing SQL Server the Right WayModernizing SQL Server the Right Way
Modernizing SQL Server the Right Way
Juan Fabian
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
Marcos Freccia
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
Naga Muruga
 
ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0
David Truxall
 
Jdbc
JdbcJdbc
Acutate - Using Stored Procedure
Acutate - Using Stored ProcedureAcutate - Using Stored Procedure
Acutate - Using Stored Procedure
Aishwarya Savant
 
Continuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data ManagementContinuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data Management
guest2e11e8
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
MSDEVMTL
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
Syed Asrarali
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
Syed Asrarali
 
Cloud application architecture with Microsoft Azure
Cloud application architecture with Microsoft AzureCloud application architecture with Microsoft Azure
Cloud application architecture with Microsoft Azure
Guillermo Zepeda Selman
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
sweetysweety8
 
Sql basics 2
Sql basics   2Sql basics   2
Sql basics 2
Raghu nath
 
Procedures and triggers in SQL
Procedures and triggers in SQLProcedures and triggers in SQL
Procedures and triggers in SQL
Vikash Sharma
 
JDBC ppt
JDBC pptJDBC ppt
JDBC ppt
Rohit Jain
 
Cooper Oracle 11g Overview
Cooper Oracle 11g OverviewCooper Oracle 11g Overview
Cooper Oracle 11g Overview
moin_azeem
 
Windows Mobile 5.0 Data Access And Storage Webcast
Windows Mobile 5.0 Data Access And Storage WebcastWindows Mobile 5.0 Data Access And Storage Webcast
Windows Mobile 5.0 Data Access And Storage Webcast
Vinod Kumar
 
Automated rock testing tracker
Automated rock testing trackerAutomated rock testing tracker
Automated rock testing tracker
Mir Mustafa Ali
 
Overview Of JDBC
Overview Of JDBCOverview Of JDBC
Overview Of JDBC
Mindfire Solutions
 

Similar to Jdbc 2 (20)

Chapter09
Chapter09Chapter09
Chapter09
 
Modernizing SQL Server the Right Way
Modernizing SQL Server the Right WayModernizing SQL Server the Right Way
Modernizing SQL Server the Right Way
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0
 
Jdbc
JdbcJdbc
Jdbc
 
Acutate - Using Stored Procedure
Acutate - Using Stored ProcedureAcutate - Using Stored Procedure
Acutate - Using Stored Procedure
 
Continuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data ManagementContinuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data Management
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
 
Cloud application architecture with Microsoft Azure
Cloud application architecture with Microsoft AzureCloud application architecture with Microsoft Azure
Cloud application architecture with Microsoft Azure
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Sql basics 2
Sql basics   2Sql basics   2
Sql basics 2
 
Procedures and triggers in SQL
Procedures and triggers in SQLProcedures and triggers in SQL
Procedures and triggers in SQL
 
JDBC ppt
JDBC pptJDBC ppt
JDBC ppt
 
Cooper Oracle 11g Overview
Cooper Oracle 11g OverviewCooper Oracle 11g Overview
Cooper Oracle 11g Overview
 
Windows Mobile 5.0 Data Access And Storage Webcast
Windows Mobile 5.0 Data Access And Storage WebcastWindows Mobile 5.0 Data Access And Storage Webcast
Windows Mobile 5.0 Data Access And Storage Webcast
 
Automated rock testing tracker
Automated rock testing trackerAutomated rock testing tracker
Automated rock testing tracker
 
Overview Of JDBC
Overview Of JDBCOverview Of JDBC
Overview Of JDBC
 

More from Tuan Ngo

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 en
Tuan Ngo
 
Net framework
Net frameworkNet framework
Net framework
Tuan Ngo
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable types
Tuan Ngo
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iterators
Tuan Ngo
 
13 collections
13   collections13   collections
13 collections
Tuan Ngo
 
11 exception handling
11   exception handling11   exception handling
11 exception handling
Tuan Ngo
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegates
Tuan Ngo
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexers
Tuan Ngo
 
10 namespace
10  namespace10  namespace
10 namespace
Tuan Ngo
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
Tuan Ngo
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphism
Tuan Ngo
 
5 arrays
5   arrays5   arrays
5 arrays
Tuan Ngo
 
6 class and methods
6    class and methods6    class and methods
6 class and methods
Tuan Ngo
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operators
Tuan Ngo
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructs
Tuan Ngo
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#
Tuan Ngo
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data types
Tuan Ngo
 
Jdbc 7
Jdbc 7Jdbc 7
Jdbc 7
Tuan Ngo
 
Jdbc 6
Jdbc 6Jdbc 6
Jdbc 6
Tuan Ngo
 
Jdbc 3
Jdbc 3Jdbc 3
Jdbc 3
Tuan Ngo
 

More from Tuan Ngo (20)

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 en
 
Net framework
Net frameworkNet framework
Net framework
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable types
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iterators
 
13 collections
13   collections13   collections
13 collections
 
11 exception handling
11   exception handling11   exception handling
11 exception handling
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegates
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexers
 
10 namespace
10  namespace10  namespace
10 namespace
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphism
 
5 arrays
5   arrays5   arrays
5 arrays
 
6 class and methods
6    class and methods6    class and methods
6 class and methods
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operators
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructs
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data types
 
Jdbc 7
Jdbc 7Jdbc 7
Jdbc 7
 
Jdbc 6
Jdbc 6Jdbc 6
Jdbc 6
 
Jdbc 3
Jdbc 3Jdbc 3
Jdbc 3
 

Recently uploaded

Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 

Recently uploaded (20)

Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 

Jdbc 2

  • 1. JDBC Session 2 tnngo2@gmail.com
  • 2. Stored Procedure can be defined as a group of SQL statements performing a particular task used to group or batch a set of operations or queries to be executed on a database server Faster, more efficient than individual SQL query stmt
  • 3. Characteristics of Stored Procedure contain SQL statements using constructs and control structures be invoked by name in a application allow an application program to run in two parts such as the application on the client and the stored procedure on the server
  • 5. Benefits of Stored Procedure Reduced network traffic Enhanced hardware and software capabilities Distributed computing Increased security Client need not have the privilege as DBA Decrease in development cost Reusing a common stored procedure Centralized control Security, administrator and maintenance in one place at the server
  • 6. Create stored procedure using Statement obj Step 1:
  • 7. Create stored procedure using Statement obj Step 2:
  • 8. Parameters of a stored procedure Stored procedures can accept data in the form of input parameters that are specified at execution time There are three parameters IN cannot changed or reassigned within module is constant OUT IN/OUT
  • 9. Creating and executed CallableStatement does not contain the stored procedure itself only a call to it. CallableStatement cst = cn.preparedCall(“{call functioname(?,?)}”)
  • 10. ResultSet A default result set object cannot be updated or scrolled backward and forward. By default the cursor moves forward only. The characteristics of ResultSet are Scrollable Updatable Holdable Check whether the cursor stays open after a commit
  • 11. Scrollable ResultSet allows the cursor to be moved to any row in the result set.
  • 12. Scrollable ResultSet allows the cursor to be moved to any row in the result set.
  • 13. ResultSet constant values TYPE_FORWARD_ONLY TYPE_SCROLL_INSENSITIVE TYPE_SCROLL_SENSITIVE
  • 14. Row Positioning Methods method of ResultSet
  • 15. Row Positioning Methods method of ResultSet interface
  • 16. Updatable “ResultSet” update rows in a result set using JAVA code rather than SQL commands. update, insert, delete
  • 17. Concurrency Updatability require database write locks to provide access to the underlying database. Because you cannot have multiple write locks concurrently Updatability in a result set is associated with concurrency in database access. Concurrency is a process wherein two events take place in parallel Two types: CONCURRENCY.READ_ONLY Result set cannot be modified CONCURRENCY.UPDATABLE Update, insert and delete can performed
  • 18. Batch Update can be defined as a set of multiple update statements that is submitted to the database for processing as a batch Statement, PreparedStatement, CallableStatement obj can be used to submit batch updates
  • 19. Batch Update Benefits: allow to request records, bring them to the client, make changes to the records on the client side, and then send the updated record back to the data source at some other time. improve performance no need to maintain a constant connection to the database
  • 20. Batch Update using “Statement ” interface Disable the auto-commit mode Create a Statement instance Add SQL commands to the batch Execute the batch commands Commit the changes in the database Remove the commands from the batch
  • 21. Batch Update using “Statement ” interface
  • 22. Batch Update using “Statement ” interface
  • 23. Batch Update using “Statement ” interface
  • 24. Batch Update using “PreparedStatement” interface
  • 25. Batch Update using “CallableStatement” interface
  • 26. Transactions is a set of one or more statements that are executed together as a unit Ensures either all the statements in the set or none of them are executed bank funds tranfer withdraw from one : completed deposit to another: not => Fail
  • 27. Properties of Transactions Atomicity all or none performed Consistency cannot break the rules such as integrity constraints Isolation no conflicts between concurrent transaction Durability recover committed transaction if needed