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
|
|
|
|
|
|
|
|
|
|
|


Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
It's not very often I get excited about a software... Read More
The Windows registry is a huge database that ensures normal... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
Software development is a risky business.Many software developers are barely... Read More
Microsoft Word is one of the most popular office applications... Read More
Combining Microsoft Business Solutions Great Plains ERP with non-Microsoft Business... Read More
Before being able to choose a secure Internet communication system,... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
Just the thought of a duel-boot scares many people away,... Read More
We were recently faced with a decision: either to let... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
It would be easy to think, like most people apparently... Read More
One of the things we can be as certain of... Read More
To all web designers out there, this article is for... Read More
For those who are unclear on the differences between the... Read More
The Windows Indexing Service provides you with the ability to... Read More
What is IRC?IRC is Internet Relay Chat. It is a... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
Bad News - the Threat is Bigger than it SeemedHow... Read More
If you copy something from a Web site or elsewhere...... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
Here is some free software tools to help you build... Read More
Great Plains Purchase Order Processing (POP) module makes up one-third... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
Ad-Aware and Spybot are probably the two most well known... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
While Ukraine is becoming a new popular IT outsourcing destination,... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
There are many commands that are used in linux on... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More


Midsize business or non-profit organization should decide if one-vendor solution... Read More
The research in the field of Natural Language Processing usually... Read More
MS CRM is very close to document workflow automation, including... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
With any good luck and a good amount of hard... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
1. With mapping software you can create a report that... Read More
Most people don't use Photoshop to its fullest capabilities. Here... Read More
This short paper will expand on two key reasons to... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
When you think... Read More
Remember old good days when your company probably had Great... Read More
The java programming language is becoming more and more popular... Read More
Do you want to get quality software at a reasonable... Read More
Since technology changes so quickly, it is hard to begin... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
A wiki is an editable text-based website. But you don't... Read More
First we had the original Google search that evolved into... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
There are so many different programs that clutter up your... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
Spyware and malware are large problems for Internet users today... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
The world of small business accounting software can be a... Read More
Find out why Spyware Removal from computers is important and... Read More
XML Server can be a Web Server that stores the... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Once upon a time not so long ago, there was... Read More
Software |