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
best cleaning company Highland Park ..The COSMIC FP (function point) software quality metric, is no... Read More
Microsoft Business Solutions Great Plains is very generic accounting application... Read More
Whether you are a small consultancy firm, a medium sized... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
We all take the computer for granted. I mean, all... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
The stakes are high when considering security, privacy, and savings,... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
Are you lost in the mess of documents that get... Read More
If there still are few unprotected computers left, I haven't... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Great Plains Purchase Order Processing (POP) module makes up one-third... Read More
Microsoft has never released a service pack for Windows98 SE,... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Microsoft Business Solutions Great Plains has many years of successful... Read More
The most important benefit of XML is its simplicity. Though... Read More
high-end home cleaning Winnetka ..Software development is a risky business.Many software developers are barely... Read More
Looks like Microsoft Great Plains becomes more and more... Read More
The Internet is reshaping every form of communications medium, and... Read More
I've been active in the Cisco Certification track for four... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
All of us know that Microsoft bought former Great Plains... Read More
I have always regretted how Microsoft price gouges and rips... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
Spyware is software or hardware installed on a computer without... Read More
The software giants don't do everything and don't always produce... Read More
Hey Guys! Don't raise your eyebrows or fear by hearing... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
All your software is stored on a hard-drive. But how... Read More
When you visit department stores and see that majority of... Read More
MicroWorld Technologies, Inc. the leading solutions provider in the area... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
What is installation in the language of technology? Installation... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
Here is some free software tools to help you build... Read More
This article illustrates the best practices to improve the performance... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
Software |