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 parveenaggarwal@hotmail.com
|
|
|
|
|
|
|
|
|
|
|


It could just be me, but my experiences with document... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
Usually workflow & messaging is realized in CRM and then... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
This article is the fourth of a series of articles... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Handling character strings in Java is supported through two final... Read More
Introduction: The creating of a computer program involves a number... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Cyberspace has opened up a new frontier with exciting possibilities... Read More
Writing software manuals is boring, isn't it? We often think:... Read More
An integral part of any quality CRM system is lead... Read More
Microsoft Business Solutions ? Great Plains has captured the US... Read More
Fundraising software lets you connect with donors in a way... Read More
How would you like to prevent spyware and adware from... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
In this short FAQ style article we would like to... Read More
MS CRM is very close to document workflow automation, including... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
People often ask me: What image file formats will Photoshop... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions.The whole... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More
Now that spyware is the single most dangerous threat to... Read More
Software development is a risky business.Many software developers are barely... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
The various resume software offered, particularly on the internet, can... Read More
SOFTWARE PIRACY We regularly hear reports... Read More


Think of this, first we had the HAM Radio, then... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Find out why Spyware Removal from computers is important and... Read More
The destruction of the Soviet Union about 15 years ago,... Read More
What is Software?Software is a set of instruction written to... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
Ad-Aware and Spybot are probably the two most well known... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
The cornerstone of successful automated office systems is the ability... Read More
Scrapbooks are very popular these days. I think that almost... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
If you have Microsoft Great Plains and support it... Read More
Stealing company information used to be the specialty of spies... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
Hey Guys! Don't raise your eyebrows or fear by hearing... Read More
Trying to figure out a stream in banning one email... Read More
Whether you have used Microsoft Word for years, have just... Read More
Are you one of those people that keeps track of... Read More
You probably didn't casually invite, or extend a formal attendance... Read More
The various resume software offered, particularly on the internet, can... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions.The whole... Read More
Microsoft Great Plains might be considered as ERP platform to... Read More
We all already got used to computer monitoring both at... Read More
With thousands of web pages added to the Net every... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
Adware is a type of Spyware program that displays some... Read More
All your software is stored on a hard-drive. But how... Read More
Software |