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 http://www.daffodildb.com
reliable home cleaners Deerfield ...Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
OEComplete is a utility for managing the personal information of... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
Upgrading. Downtime. Maintenance. Hardware obsolescence. Implementation issues. The litany of... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
While I was preparing some personal background information for a... Read More
Microsoft CRM is CRM application, maintained and supported by Microsoft... Read More
This article is the first of a series of articles... Read More
Research bears that less than 70 percent of development projects... Read More
Our opinion is based on our Microsoft Business Solutions Great... Read More
Once a business idea is selected, it is highly recommended... Read More
This article will not attempt to advocate the use of... Read More
Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Imagine something that follows you home and sets itself up... Read More
Microsoft Business Solutions ? Great Plains has captured the US... Read More
Document Manager and Version HistoryIn previous articles I have discussed... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
During the years of our consulting practice, which comes back... Read More
And kill the best layout software in the process of... Read More
The research in the field of Natural Language Processing usually... Read More
Ad-Aware and Spybot are probably the two most well known... Read More
top rated cleaning service Glencoe ...All of us know that Microsoft bought former Great Plains... Read More
I've been active in the Cisco Certification track for four... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
This article will not attempt to advocate the use of... Read More
NOTE: Please take time to read on - it may... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
One of the things we can be as certain of... Read More
Microsoft Great Plains is becoming more and more popular and... Read More
Logistics automation is often considered as barcoding extension to Sales... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
In the real world a "fire wall" is a fireproof... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Fleet Maintenance Management is a critical position in any company... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Google Inc. has launched a new software package that allows... Read More
In our opinion, traditional approach when you select ERP/MRP system... Read More
Before being able to choose a secure Internet communication system,... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Whether you have used Microsoft Word for years, have just... Read More
Best Software Act! is very popular CRM for small and... Read More
Microsoft Retail Management (RMS) and Microsoft Great Plains are retail... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
As you probably know, when Microsoft purchased Great Plains Software... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
It is now common thing when large corporation selects mid-market... Read More
Software |