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
scheduled maid service Northbrook ..The purpose of one of our projects was MS Exchange... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
If you are to buy a HelpDesk & Asset Management... Read More
Fundraising software lets you connect with donors in a way... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
It's all about turn times in the eMedia industry! The... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... 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
Microsoft Business Solutions Great Plains is mid and even corporate... Read More
We'll give you non formal view, based on our consulting... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Today's business world is fast-paced. No matter what it is... Read More
Our opinion is based on our Microsoft Business Solutions Great... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Usually workflow & messaging is realized in CRM and then... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Buying accounting software is a major investment. It's an important... Read More
Microsoft Great Plains has full-featured Manufacturing suite of modules: Capacity... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
What is installation in the language of technology? Installation... Read More
reliable maid service Highland Park ..What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
Introduction: The creating of a computer program involves a number... Read More
Microsoft Retail Management (RMS) and Microsoft Great Plains are retail... Read More
In the Clinton era the status quo was simple: you... Read More
Since technology changes so quickly, it is hard to begin... Read More
Hi, Guys,I believe a lot of programmers are trying to... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
With any good luck and a good amount of hard... Read More
You might think you don't need a firewall... Read More
Great Plains Accounting, accounting package for mid-size and small companies... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
Just the thought of a duel-boot scares many people away,... Read More
If you've been using MySQL database to store your important... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
We were recently faced with a decision: either to let... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
The intuitive algorithm.Roger Penrose considered it impossible. Thinking could never... Read More
After seeing many people complain about their weak Internet security... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
We'll give you non formal view, based on our consulting... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Microsoft CRM is now on the scene and it is... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Software |