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
![]() |
|
![]() |
|
![]() |
|
![]() |
If you are in the market for new staffing software,... Read More
Intro This concise article will tell you in plain English... Read More
Itâ??s easy to understand why you might be drawn to... Read More
Should one use Windows Update?This topic has good and valid... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
Words we choose to describe things and phenomena often show... Read More
Our hosted solution allow you to run your own search... Read More
Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
Our opinion is based on our Microsoft Business Solutions Great... Read More
In the new era of internet marketing the problem of... Read More
Have you noticed WordPerfect is gearing up for a comeback... Read More
The cornerstone of successful automated office systems is the ability... Read More
Pirated software is on the increase and now accounts for... Read More
Today's business world is fast-paced. No matter what it is... Read More
Vince Lombardi once said that, "The achievements of an organization... Read More
In this article you will find some background information about... Read More
Some companies that are in need of fleet management may... Read More
It is really interesting that a bug can create problem... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
Microsoft Great Plains and Microsoft CRM become more and more... Read More
The java programming language is becoming more and more popular... Read More
The term "document management" and "paperless office" is the subject... Read More
IntroductionDuring the early years of our modern computer era, very... Read More
Research bears that less than 70 percent of development projects... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
The intentions of this short tutorial are not to teach... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
The most important things you can do for your computer... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Each Industry and market niche has business specific and unique... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
In this small article we will be looking at the... Read More
The vast majority of us will have, at some point,... Read More
In the previous ISDN article, we looked at how and... Read More
Well, even if the combination might look very unusual, we... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Itâ??s easy to understand why you might be drawn to... Read More
Anyone who has ever used Microsoft Word knows that it... Read More
What is installation in the language of technology? Installation... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Great Plains might be considered as ERP platform to... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
The major reason I recommend getting your hands on real... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
The cornerstone of successful automated office systems is the ability... Read More
Every day millions of new web documents emerge on the... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Some companies that are in need of fleet management may... Read More
Spyware is like the new technological nuclear weapon on the... Read More
Words we choose to describe things and phenomena often show... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
While Ukraine is becoming a new popular IT outsourcing destination,... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
As you probably know, when Microsoft purchased Great Plains Software... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
Microsoft Great Plains is one of three Microsoft Business Solutions... Read More
If your company has regional and worldwide operations, you might... Read More
It is now common thing when large corporation selects mid-market... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Software |