Skip to main content

Q) How to implement batch updates in a JDBC applications?



A)
->java.sql.statement and java.sql.prepared statement interfaces have methods to support batch processing.
1) addbatch (Strinf dml) :
            This method used to add an SQL statement to the batch.
2) int [ ] executebatch() :
            this method is used to submit the group of (batch of) SQL statements at a time to the DBMS.

Comments

Popular posts from this blog

Q) How to develop a java application using MyEclipse that displays “hello world” on console

A) Step 1) Create a new java project File->new->Java project->Enter Project Name Step 2) Create a userdefined package within “src” directory (given by MyEclipse into which we store all our java files and src means java source code). Right click on “src directory->new->package->enter the package name For example: com.prince (reverse domain naming connection is fallowing by industry for package names) Step 3) Create a class with main Right click on package ->new->class->Enter the class name->select the main option. Step 4) Write System.out.println and run the application. Right click on editor->Run As->java Application.

Q) What is Batch updates?

A) ->Batch updates is a formality given by JDBC using which, DML SQL statement can be grouped physically into one unit and at a time submitted to the DBMS for processing as a batch. ->Batch updates mechanism improves performance some times by reducing the number of client/server interaction. ->we have 2 kinds of business Systems. 1) OLTPS (Online Transaction Processing Systems) 2) Batch processing System. To support batch processing systems, batch updates is given in JDBC. ->In case of OLTP, end user waits the system responds after giving input into the system. ->in case of batch processing system, end user doesn’t wait for the systems responds. ATM application is an example for OLTP. ->At the end of every month, all accounts must be created by their earned interest is an example use case of batch processing.

JDBC Basics

11) What are the Steps to create to database server?  12) Explain about Loading JDBC driver? 13) Explain about preparing the connection string? 14) Explain about requesting for connection? 15) Develop a JDBC application that connects to oracle database server by using database product wander provided JDBC driver. 16) Explain about Types of java database connectivity approaches?  17) Develop a JDBC application that connects to oracle server using JDBC-ODBC approach. 18) Why to close database connection? 19) JDBC application performing database operation? 20) Explain about create statement object? 21) Explain about submitting the SQL statement?  22) Develop a JDBC application that deletes all the employees from the db. Make use of pure JDBC approach of connectivity. 23) Develop a JDBC application that creates one account in the database. Make use of JDBC-ODBC approach. 24) Develop a JDBC application that increase the balance of the account holder by 500. 25) Develop a JDBC...