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
residential cleaning services Wilmette ...Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Research bears that less than 70 percent of development projects... Read More
Currently Microsoft Business Solutions is on the way of creating... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
What is Software?Software is a set of instruction written to... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
How to delete the user? This is the first problem... Read More
1. With mapping software you can create a report that... 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
Microsoft Business Solutions Great Plains was designed back in the... Read More
Remember old good days when your company probably had Great... Read More
Finally, you have some time to personalize your desktop with... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
Microsoft Great Plains is main mid-market application from Microsoft Business... Read More
One of the main reasons business owners and entrepreneurs use... Read More
Microsoft Great Plains - Microsoft Business Solutions accounting and ERP... Read More
A UNIX Shell is in simplest terms, a command line... Read More
I've been active in the Cisco Certification track for four... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
C++ Function templates are those functions which can handle different... Read More
The term "document management" and "paperless office" is the subject... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Microsoft CRM is CRM answer from Microsoft and attempt to... Read More
professional cleaning service Highland Park ...Is your PC is slow and wimpy? Then you need... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
Microsoft Business Solutions ? Navision is an integrated solution for... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
I completed an experiment recently. I wanted to find out... Read More
Background: For many organizations like ours, the interim target of... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
Hey Guys! Don't raise your eyebrows or fear by hearing... Read More
When it comes to screenplay software each screenwriter needs to... Read More
This article is the third of a series of articles... Read More
Combining Microsoft Business Solutions Great Plains ERP with non-Microsoft Business... Read More
When making a decision to buy any piece of software... Read More
Each Industry and market niche has business specific and unique... Read More
We all take the computer for granted. I mean, all... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
This short paper will expand on two key reasons to... Read More
We don't think about mainframe software pricing anymore, we just... Read More
1. What determines the software price? Is it Per Seat... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
The term "document management" and "paperless office" is the subject... Read More
Software |