SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformationSon Nguyen
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scopekunal vishe
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation FilterAnkush Sharma
 
Mule scopes request_response_scope
Mule scopes request_response_scopeMule scopes request_response_scope
Mule scopes request_response_scopekunal vishe
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-PresentationChuck Walker
 
Mule Custom Aggregator
Mule Custom AggregatorMule Custom Aggregator
Mule Custom AggregatorAnkush Sharma
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connectorAnkush Sharma
 
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 SplitterAnkush Sharma
 
Mule generic connector
Mule generic connectorMule generic connector
Mule generic connectorAnkush 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 TasksPramod Singla
 
Mule properties
Mule propertiesMule properties
Mule propertiesGandham38
 

Tendances (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
 

En vedette

Tervela Streaming for Web & Mobile
Tervela Streaming for Web & MobileTervela Streaming for Web & Mobile
Tervela Streaming for Web & Mobiletervela
 
Long Lasting Memories Project Presentation
Long Lasting Memories Project PresentationLong Lasting Memories Project Presentation
Long Lasting Memories Project PresentationIlias Trochidis
 
Jdbc connectivity
Jdbc connectivityJdbc connectivity
Jdbc connectivityarikazukito
 
Java session16
Java session16Java session16
Java session16Niit Care
 
Interface result set
Interface result setInterface result set
Interface result setmyrajendra
 
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.1DataStax Academy
 
Jdbc session01
Jdbc session01Jdbc session01
Jdbc session01Niit Care
 
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 louiechotliaohuanzhuo
 
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
 
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
 

En vedette (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
 

Similaire à Jdbc 2

Modernizing SQL Server the Right Way
Modernizing SQL Server the Right WayModernizing SQL Server the Right Way
Modernizing SQL Server the Right WayJuan Fabian
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016Marcos Freccia
 
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.0David Truxall
 
Acutate - Using Stored Procedure
Acutate - Using Stored ProcedureAcutate - Using Stored Procedure
Acutate - Using Stored ProcedureAishwarya 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 Managementguest2e11e8
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 noveltiesMSDEVMTL
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14Syed Asrarali
 
Cloud application architecture with Microsoft Azure
Cloud application architecture with Microsoft AzureCloud application architecture with Microsoft Azure
Cloud application architecture with Microsoft AzureGuillermo Zepeda Selman
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management Systemsweetysweety8
 
Procedures and triggers in SQL
Procedures and triggers in SQLProcedures and triggers in SQL
Procedures and triggers in SQLVikash Sharma
 
Cooper Oracle 11g Overview
Cooper Oracle 11g OverviewCooper Oracle 11g Overview
Cooper Oracle 11g Overviewmoin_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 WebcastVinod Kumar
 
Automated rock testing tracker
Automated rock testing trackerAutomated rock testing tracker
Automated rock testing trackerMir Mustafa Ali
 

Similaire à 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
 

Plus de 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 enTuan Ngo
 
Net framework
Net frameworkNet framework
Net frameworkTuan 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 typesTuan Ngo
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iteratorsTuan Ngo
 
13 collections
13   collections13   collections
13 collectionsTuan Ngo
 
11 exception handling
11   exception handling11   exception handling
11 exception handlingTuan Ngo
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegatesTuan Ngo
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexersTuan Ngo
 
10 namespace
10  namespace10  namespace
10 namespaceTuan 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 polymorphismTuan Ngo
 
6 class and methods
6    class and methods6    class and methods
6 class and methodsTuan Ngo
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operatorsTuan Ngo
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructsTuan 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 typesTuan Ngo
 

Plus de 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
 

Dernier

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Dernier (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

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