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
![]() |
|
![]() |
|
![]() |
|
![]() |
Once a business idea is selected, it is highly recommended... Read More
Most people understand that the "hardware" part of their computer... Read More
Best Software Act! is very popular CRM for small and... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
While Adobe is the most known maker of PDF tools,... Read More
It could just be me, but my experiences with document... Read More
Now is the time to look at an alternative to... Read More
When you double-click a layer in the Layer Palette, you... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics/eEnterprise... Read More
Do you remember that frustrating feeling when you find an... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Now there are Three Steps To Heaven Just listen and... Read More
One of the things we can be as certain of... Read More
It is really interesting that a bug can create problem... Read More
Program Flow is what you think it is. How the... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
Almost all new and major brand of PCs come with... Read More
When you own a small business, time is money. And... Read More
Microsoft CRM is winning market share step-by-step from such the... Read More
Background: For many organizations like ours, the interim target of... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
Words we choose to describe things and phenomena often show... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
In linux, one of great commands for finding out information... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Let's say that you have a software project that's under... Read More
Do you want to get quality software at a reasonable... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
One of the main reasons business owners and entrepreneurs use... Read More
The most important benefit of XML is its simplicity. Though... Read More
Fundraising software lets you connect with donors in a way... Read More
All of us know that Microsoft bought former Great Plains... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
The software giants don't do everything and don't always produce... Read More
Some companies that are in need of fleet management may... Read More
With many manufacturing shops heading over seas in favor of... Read More
Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
Running Applications in Compatibility Mode With Windows XP, you can... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Microsoft Business Solutions Great Plains is very popular ERP platform... Read More
This is the tutorial where we really get into programming.... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
So let's begin crunching down these 300 images using Adobe... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics/eEnterprise... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
If you use Microsoft Outlook (or similar applications) for e-mailing,... Read More
Microsoft Retail Management System serves retail single store as well... Read More
So, why should you use any O/R mapping tool? I... Read More
Microsoft Business Solutions ? Great Plains has captured the US... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Almost all new and major brand of PCs come with... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
Are you a whiz at calculating financial information? Not the... Read More
Scrapbooks are very popular these days. I think that almost... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
When you double-click a layer in the Layer Palette, you... Read More
Is your PC is slow and wimpy? Then you need... Read More
There are several kinds of software piracy. The bottom line... Read More
Our hosted solution allow you to run your own search... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
The various resume software offered, particularly on the internet, can... Read More
Software |