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
maide service in Lake Forest ...Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
This tutorial covers OLAP solutions used by Data warehouses and... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
Microsoft Word is one of the most popular office applications... Read More
Research bears that less than 70 percent of development projects... Read More
For those who are unclear on the differences between the... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Using professional icons in your application or website can bring... Read More
So let's begin crunching down these 300 images using Adobe... Read More
For a windows user like me, just can watch with... Read More
All your software is stored on a hard-drive. But how... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
The first thing that you will notice about Linux Red... Read More
Assertion facility is added in J2SE 1.4. In order to... Read More
Microsoft Business Solutions Great Plains has Project Accounting module where... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
Our hosted solution allow you to run your own search... Read More
Microsoft has never released a service pack for Windows98 SE,... Read More
Program Flow is what you think it is. How the... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
In this short FAQ style article we would like to... Read More
reliable home cleaners Lake Forest ...Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
We don't think about mainframe software pricing anymore, we just... Read More
The research in the field of Natural Language Processing usually... Read More
Lotus Notes Domino is very efficient in electronic document workflow... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
In this article you will find some background information about... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
First we had the original Google search that evolved into... Read More
Microsoft Great Plains fits to majority of industries, in the... Read More
Every day millions of new web documents emerge on the... Read More
Best Software Act! is very popular CRM for small and... Read More
There are two major WYSIWYG(What You See Is What You... Read More
How do you run a program on a remote server... Read More
If you would like to pick something from Microsoft, or... Read More
It is possible that if one avoided all sources of... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
XML Server can be a Web Server that stores the... Read More
Although statistics often is blamed for various deadly sins --... Read More
What is Software?Software is a set of instruction written to... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
NOTE: Please take time to read on - it may... Read More
This short paper will expand on two key reasons to... Read More
Software |