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
Culver prom limo ..Well, even if the combination might look very unusual, we... Read More
Did you ever give a thought to the number of... Read More
Since its release in 1987, QuarkXpress had made an immediate... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
Some introduction into Great Plains Software products, now Microsoft Business... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
Spyware is like the new technological nuclear weapon on the... Read More
Manufacturing in the USA is far away down from mid... Read More
The destruction of the Soviet Union about 15 years ago,... Read More
I love new technology. I am still ready to wait... Read More
Anti-virus software is used to find, remove or fix files... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
How would you like to prevent spyware and adware from... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
I suggest that you do not spend a lot of... Read More
Most people understand that the "hardware" part of their computer... Read More
Vince Lombardi once said that, "The achievements of an organization... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
Lotus Notes Domino is very efficient in electronic document workflow... Read More
For those who are unclear on the differences between the... Read More
Buying accounting software is a major investment. It's an important... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
Considering whether or not your software company should hire a... Read More
If you are in the market for new staffing software,... Read More
Wood Dale limo ..Best Software Act! is very popular CRM for small and... Read More
In the previous ISDN article, we looked at how and... Read More
Introduction To ISDN, Part III: Configuring PPP PAP AuthenticationNow we... Read More
Great Plains Purchase Order Processing (POP) module makes up one-third... Read More
The vast majority of us will have, at some point,... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
Bill of Lading is required report for Logistics and Freight... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
In a previous article, I wrote about OpenOffice... Read More
Collaboration SoftwareCollaboration Software, also known as group collaboration software or... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
Is your PC is slow and wimpy? Then you need... Read More
Remember back in the days where screensavers were the coolest... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Domino server is a buffer between the operation system and... Read More
If you have Microsoft Great Plains and support it for... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Microsoft CRM is now on the scene and it is... Read More
After almost two decades of existence, Quark has become the... Read More
Software |