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
![]() |
|
![]() |
|
![]() |
|
![]() |
In the case when you represent mid-size or mid-size-to-large business,... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Hi, Guys,I believe a lot of programmers are trying to... Read More
Designing without tables by using CSS layouts is fast becoming... Read More
In linux, one of great commands for finding out information... Read More
Corporate ERP/MRP selection might be tough one, especially considering very... Read More
Are you a database professional? Do you work with a... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics/eEnterprise... Read More
C++ Function templates are those functions which can handle different... Read More
Running Applications in Compatibility Mode With Windows XP, you can... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
The java programming language is becoming more and more popular... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
New post-recession era has new features, which didn't exist in... Read More
While Ukraine is becoming a new popular IT outsourcing destination,... Read More
Are you lost in the mess of documents that get... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
Music downloads are off the charts! We're listening to digital... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
The objective for Zandi Digital is to make available clever... Read More
While paper labeling CDs and DVDs may appear to be... Read More
Each Industry and market niche has business specific and unique... Read More
Microsoft Great Plains is one of three Microsoft Business Solutions... Read More
The vast majority of us will have, at some point,... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
The destruction of the Soviet Union about 15 years ago,... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
I've been active in the Cisco Certification track for four... Read More
Did you ever give a thought to the number of... Read More
With thousands of web pages added to the Net every... Read More
You turn on your computer, and it doesn't look quite... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
At the end of XX century, in the late 1990th... Read More
If you have been running Windows XP for a couple... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Stealing company information used to be the specialty of spies... Read More
The Windows Indexing Service provides you with the ability to... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More
Fortunately one of the most common reasons cited for the... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
It is really interesting that a bug can create problem... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
If you look back to the history, you will see... Read More
TikiWiki is open source software - it is written in... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
Spyware is software or hardware installed on a computer without... Read More
Imagine something that follows you home and sets itself up... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Microsoft CRM is now on the scene and it is... Read More
The software giants don't do everything and don't always produce... Read More
Domino server is a buffer between the operation system and... Read More
To all web designers out there, this article is for... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
The major reason I recommend getting your hands on real... Read More
Great Plains Integration Manager scripting and translation - overview for... Read More
If you feel intimidated when someone tries to teach you... Read More
Software |