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
We live in a post-industrial age where information is the... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Looks like Microsoft Great Plains becomes more and more... Read More
MicroWorld Technologies, Inc. the leading solutions provider in the area... Read More
Handling character strings in Java is supported through two final... Read More
While Ukraine is becoming a new popular IT outsourcing destination,... Read More
OEComplete is a utility for managing the personal information of... Read More
Not every software testing project can or should be automated.... Read More
One of the main reasons business owners and entrepreneurs use... Read More
Several years ago Microsoft purchased Great Plains Software, then Navision... Read More
Once a business idea is selected, it is highly recommended... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
Three highly respected names in Human Resources have joined forces... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
A wiki is an editable text-based website. But you don't... Read More
Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
When you first think about multicurrency ? you probably have... Read More
The stakes are high when considering security, privacy, and savings,... Read More
When you buy a computer, it most likely comes with... Read More
The Windows registry is a huge database that ensures normal... Read More
In today's business world it's all but impossible to escape... Read More
Great Plains Accounting, accounting package for mid-size and small companies... Read More
Microsoft Business Solutions ? Great Plains has captured the US... Read More
Manufacturing in the USA is far away down from mid... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
In the Clinton era the status quo was simple: you... Read More
It's not very often I get excited about a software... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
I've been active in the Cisco Certification track for four... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
If you have Microsoft Great Plains as main accounting and... Read More
The adware and spyware definitions list is very long. But... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Well, even if the combination might look very unusual, we... Read More
Now that spyware is the single most dangerous threat to... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
So, you've bought a new Macintosh, and now you may... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
Using professional icons in your application or website can bring... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
Adware is a type of Spyware program that displays some... Read More
Most people understand that the "hardware" part of their computer... Read More
... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Just the thought of a duel-boot scares many people away,... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
There are certain pluses and minuses in both cases and... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft Business Solutions Great Plains serves to the wide spectrum... Read More
Internet worms. Is your PC infected?If your computer has become... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
Since technology changes so quickly, it is hard to begin... Read More
It's all about turn times in the eMedia industry! The... Read More
And kill the best layout software in the process of... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
Software |