how can we do batch updates using callablestatement interface

how can we do batch updates using callablestatement interface

how can we do batch updates using callablestatement interface

View Answers

May 9, 2012 at 4:38 PM

The batch update is the ability to process more than one statement at once.CallableStatement.executeBatch() method is used to execute the batch of statements.

CallableStatement cstmt = con.prepareCall("{call updatePrices(?, ?)}");
 cstmt.setString(1, "A");
 cstmt.setFloat(2, 8.49f);
 cstmt.addBatch();

 cstmt.setString(1, "B");
 cstmt.setFloat(2, 9.49f);
 cstmt.addBatch();

 int [] updateCounts = cstmt.executeBatch();









Related Tutorials/Questions & Answers:
How can we solve this puzzle using java ?
How can we solve this puzzle using java ?  Sachin likes sweets a lot... someone help how can we write the code... contiguous stalls. So, he can buy from as many stalls as he wants, but all
HOW TO DO WEBSITE INTERFACE FOR JAVA MODULE
HOW TO DO WEBSITE INTERFACE FOR JAVA MODULE  Hi , Greetings. I... an interface ? any 3rd party software like frontpage can do or other method ? PLEASE... information etc. All these modules work fine in browser. I use JCreator. How to place
Advertisements
Can we do data science after 12th?
Can we do data science after 12th?  Hi, I am beginner in Data... we do data science after 12th? Try to provide me good examples or tutorials links so that I can learn the topic "Can we do data science after 12th?"
How can we encrypt the username and password using PHP?
How can we encrypt the username and password using PHP?  How can we encrypt the username and password using PHP
How can we create a database using PHP and mysql?
How can we create a database using PHP and mysql?  How can we create a database using PHP and mysql
How can we get second of the current time using date function?
How can we get second of the current time using date function?  How can we get second of the current time using date function
How can we find the number of rows in a result set using PHP?
How can we find the number of rows in a result set using PHP?   How can we find the number of rows in a result set using PHP
How do we create session factory in hibernate?
How do we create session factory in hibernate?  Hi, How do we create session factory in hibernate? thanks
How do we create custom component
How do we create custom component  How do we create custom component in JSF. I couldnot find any category for JSF questions
How can I do it? .click();
How can I do it? .click();  I have a very unusual problem. I want to make a script like this: <script> x = document.getElementById... want that it make mouseup in this element. How can I do it, because if I write
can we use class in jsp which implements interface
can we use class in jsp which implements interface   can we use class in jsp which implements interface
How we can integrate ASP .net website to payment gateway using SOAP xml request and response using wsdl.
How we can integrate ASP .net website to payment gateway using SOAP xml request and response using wsdl.  We have a e-commerce website in ASP.net, c... with wsdl format. As i'm new in development. How i can integrate our website
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
What is the maximum size of a file that can be uploaded using PHP and how can we change this?  What is the maximum size of a file that can be uploaded using PHP and how can we change
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How can we know the number of days between two given dates using PHP?
How can we know the number of days between two given dates using PHP?  How can we know the number of days between two given dates using PHP
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How many ways we can retrieve the date in result set of mysql using php?
How many ways we can retrieve the date in result set of mysql using php?  How many ways we can retrieve the date in result set of mysql using php
How can I do data science course?
How can I do data science course?  Hi, I am beginner in Data Science... can I do data science course? Try to provide me good examples or tutorials links so that I can learn the topic "How can I do data science course?"
How can we extract string 'roseindia.net ' from a string http://deepak@roseindia. net using regular expression of php?
How can we extract string 'roseindia.net ' from a string http://deepak@roseindia. net using regular expression of php?   How can we extract string 'roseindia.net ' from a string http://deepak@roseindia. net using regular
How can we get the properties (size, type, width, height) of an image using php image functions?
How can we get the properties (size, type, width, height) of an image using php image functions?  How can we get the properties (size, type, width, height) of an image using php image functions
Using image in WML We can use the
this lesson we will write application that images. We can use..., in that case we can use the alt property of <img>... Using
JDBC: Batch Insert Example
JDBC: Batch Insert Example In this tutorial, you will learn how to do batch insertion of records using JDBC API. Batch Insert : When you want to insert... insertion concept. We can insert multiple rows using single connection
struts2 how can we add an radio button to form using a class(doa)
struts2 how can we add an radio button to form using a class(doa)  Hi... button on the registration form how to do plz help me out here is my code model...; plz sugest me how to use the class means how should i refer it here  
struts2 how can we add an radio button to form using a class(doa)
struts2 how can we add an radio button to form using a class(doa)  Hi... button on the registration form how to do plz help me out here is my code model...; plz sugest me how to use the class means how should i refer it here  
Using httpservletresponse interface
Using httpservletresponse interface  How do you use httpservletresponse interface?   Example: package roseindia; import... of Httpservletresponse interface. This example shows how
JDBC add batch, JDBC add batch Example, JDBC add batch example code
. In case of JDBC Batch update you can include many updates in the same batch...JDBC add batch Making JDBC batch update example In this section we will learn how use JDBC add batch to make JDBC batch update. The JDBC batch update
JDBC: Batch Update Example
concept. We can update multiple rows using single connection in batch update...JDBC: Batch Update Example In this tutorial, you will learn how to do batch update of records using JDBC API. Batch Update : When you want to update
Can an Interface implement another Interface?
Can an Interface implement another Interface?   Hi, Can an Interface implement another Interface? Thanks
Can an Interface extend another Interface?
Can an Interface extend another Interface?   Hi, Can an Interface extend another Interface? thanks
How can we destroy the cookie?
How can we destroy the cookie?   How can we destroy the cookie
how do i upload a file by using servlet or jsp?
how do i upload a file by using servlet or jsp?  hi plz tell me the write java code
how can i do group tagging in portlet factory
how can i do group tagging in portlet factory  how can i do group tagging in portlet factory
How do i validate form using javascript and send data to database?
How do i validate form using javascript and send data to database?  I need a "JOIN US" form that can validate using javascript and be able to connect with and post data into a database. The details to be validated and posted
How do we create new table apart from mapping with existing table ?
How do we create new table apart from mapping with existing table ?  Hi, How do we create new table apart from mapping with existing table ? Thanks
how to fetch data fron facebbok using spring batch and hibernate ?
how to fetch data fron facebbok using spring batch and hibernate ?  how to fetch data from facebbok using spring batch and hibernate ? Means i have to get all details of data from one source like facebook using id ans save all
How can we register the variables into a session?
How can we register the variables into a session?  How can we register the variables into a session
How can we repair a MySQL table?
How can we repair a MySQL table?  How can we repair a MySQL table
How can we know that a session is started or not?
How can we know that a session is started or not?  How can we know that a session is started
How we can create a table through procedure ?
How we can create a table through procedure ?  How we can create a table through procedure
how can we store the encrypted passwaord in swings?
how can we store the encrypted passwaord in swings?   how can we store the encrypted passwaord in swings
Examine Interface Example
Examine Interface Example       In this part of tutorial we will discuss how do you know...; To know that given class is an Interface or Class we can use  boolean method
Why do we use ORM?
Why do we use ORM?  Why do we use ORM?   ORM is technology... programming. In ORM we define the way of mapping of classes to table and also define the mapping of which property for which column. In ORM we can use plain java
Do we have AI yet?
Do we have AI yet?  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: Do we have AI yet... the topic "Do we have AI yet?". Also tell me which is the good training
How can we save a data list in jsf?
How can we save a data list in jsf?  I have a code in jsf that fires a query in Data Base each time it is called, i have added a validation check... it is called again. I tried using save State but it did not help as other functions got
how we can create website through java
how we can create website through java  Dear actually i wanna ask query about creation of website through java then how we can create web site through java plz help me..........i have already a web site ....specially for premium
How can we get hibernate statistics?
How can we get hibernate statistics?  Hi, How can we get hibernate statistics? Thanks,   Hi, The Hibernate statistics is one of the most usable feature of Hibernate, having some hidden concepts, is the power

Ads