This article illustrates the best practices to improve the performance of Daffodil DB / One$DB JDBC Driver. This article focuses on how to improve the performance of a Daffodil DB / One$DB JDBC application using Statement, PreparedStatemnt, CallableStatement and ResultSet interfaces. Choosing the right statement interfaces and right methods according to your SQL query plays a vital role in improving the performance of a JDBC Driver.
JDBC Overview
JDBC API provides standard set of interfaces to work with databases like Daffodil DB / One$DB, Oracle, Derby etc.
Connection interface encapsulates database connection functionality, Statement interface encapsulates SQL statement representation and execution functionality whereas ResultSet interface encapsulates retrieving data which comes from the execution of a SQL query using Statement.
Following are the basic steps to write a JDBC program.
1. Import "java.sql" and "javax.sql" packages. (Import "javax.sql", if advanced JDBC feature like XA is to be used)
2. Load Daffodil DB JDBC driver (embedded or network JDBC Driver)
3. Establish connection to database using Connection interface
4. Create a Statement
5. Execute the Statement
6. Retrieve results by using ResultSet interface
7. Close Statement and Connection
Choosing right Statement interface:
There are three types of Statement interfaces in JDBC to represent/execute a SQL query-Statement, PreparedStatement and CallableStatement. Statement is used for executing static SQL statement with no input and output parameters; PreparedStatement is used to execute dynamic SQL statement with input parameters whereas CallableStatement is used to execute dynamic SQL with both input and output parameters. One important thing to note about PreparedStatement and CallableStatement is that they can also be used for static SQL statements. However, CallableStatement is mainly meant for stored procedures.
PreparedStatement gives better performance when compared to Statement because it is pre-parsed and pre-compiled. This means that compilation and parsing of such statement is done only once by the database. Afterwards the database reuses the already parsed and compiled statement. This significantly improves the performance because whenever a statement has to be executed repeatedly, it doesn't need to be parsed and compiled time and again. So the overload incurred by parsing and compiling the same statement can be reduced.
When there is a requirement for single request to process multiple complex statements, CallableStatement gives better performance as compared to PreparedStatement and Statement.
To read the full article please visit http://www.daffodildb.com/daffodildb-performance-tuning.html
This article has been contributed by (Mr.) Parveen Aggarwal, Technical Consultant to DSL India (http://www.daffodildb.com). With more than 6 years of industry experience in Java and allied technologies, he has an in-depth understanding of J2EE, J2ME and database management systems. Parveen is currently working on the concept of data-archiving in embedded databases. He can be contacted at parveenaggarwal@hotmail.com
When you first think about multicurrency ? you probably have... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
If you are in the market for new staffing software,... Read More
All of us know that Microsoft bought former Great Plains... Read More
There are many commands that are used in linux on... Read More
Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
How do you run a program on a remote server... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
Once upon a time not so long ago, there was... Read More
Navision Software was purchased by Microsoft and now it is... Read More
Microsoft Business Solutions Great Plains has many years of successful... Read More
Let us give you - developer some hints in the... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
In order to implement VLANs in a network environment, you'll... Read More
The Software 2005 conference is now a wrap. This conference,... Read More
You would like to protect your documents, wouldn't you? Reasons... Read More
FTP stands for "file transfer protocol". FTP is basically a... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
SAP Inc., a global leader in client/server enterprise application software... Read More
In this article you will find some background information about... Read More
Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Once a business idea is selected, it is highly recommended... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
In this small article we will be looking at the... Read More
Research bears that less than 70 percent of development projects... Read More
ERP Consulting industry is on the way to serve clients... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
When it comes to screenplay software each screenwriter needs to... Read More
MS CRM is very close to document workflow automation, including... Read More
I've been active in the Cisco Certification track for four... Read More
Around the same time Microsoft made its move with .Net... Read More
Domino server is a buffer between the operation system and... Read More
Before September 1995, Microsoft Windows was an MS-DOS program. DOS... Read More
The purpose of one of our projects was MS Exchange... Read More
ERP (Enterprise Resource Planning) Overview covers What is ERP, Brief... Read More
Words we choose to describe things and phenomena often show... Read More
Shareware is software that you can try before you buy;... Read More
This article will not attempt to advocate the use of... Read More
User interfaces and accessibility are some of the most important... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
Some introduction into Great Plains Software products, now Microsoft Business... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
With this small article we are continuing Microsoft Business Solutions... Read More
Did you ever want to erase everything on your computer?... Read More
This tutorial covers OLAP solutions used by Data warehouses and... Read More
If you are in the market for new staffing software,... Read More
Enabling Chinese input is quick and easy, there are only... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
As seeing large number of implementations ? in our case... Read More
Microsoft Business Solutions Great Plains is very popular ERP platform... Read More
The first thing that you will notice about Linux Red... Read More
Microsoft CRM is now on the scene and it is... Read More
Microsoft Business Solutions Great Plains is very generic accounting application... Read More
Whether you are an experienced web programmer or a complete... Read More
I have always regretted how Microsoft price gouges and rips... Read More
If you copy something from a Web site or elsewhere...... Read More
In part III of this ISDN primer, we learned that... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Our hosted solution allow you to run your own search... Read More
Software |