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
![]() |
|
![]() |
|
![]() |
|
![]() |
Microsoft CRM is CRM answer from Microsoft and attempt to... Read More
Microsoft Business Solutions Great Plains has Project Accounting module where... Read More
This short paper will expand on two key reasons to... Read More
Not all of us have the luxury of working both... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
The term "document management" and "paperless office" is the subject... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
As we could imagine, if you are reading this article... Read More
If you are in a business that passes documents around... Read More
Microsoft Great Plains is one of three Microsoft Business Solutions... Read More
Following tips help you to learn a software in lesser... Read More
This is a short article, written in question/answer/FAQ style to... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
Pirated software is on the increase and now accounts for... Read More
Microsoft Business Solutions Great Plains has many years of successful... Read More
Navision Software was purchased by Microsoft and now it is... Read More
This article illustrates the best practices to improve the performance... Read More
Microsoft Great Plains serves the wide spectrum of horizontal markets.... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Most people understand that the "hardware" part of their computer... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
After almost two decades of existence, Quark has become the... Read More
Although statistics often is blamed for various deadly sins --... Read More
The Software 2005 conference is now a wrap. This conference,... Read More
Internet worms. Is your PC infected?If your computer has become... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
When you own a small business, time is money. And... Read More
With any good luck and a good amount of hard... Read More
Three highly respected names in Human Resources have joined forces... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
IntroductionPHP can be used for a lot of different things,... Read More
In this small article we will show you the possible... Read More
The destruction of the Soviet Union about 15 years ago,... Read More
Are you a whiz at calculating financial information? Not the... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
Mike Dunville* had a decision to make. As the new... Read More
Anti-virus software is used to find, remove or fix files... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
We'll give you non formal view, based on our consulting... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
Microsoft Word is one of the most popular office applications... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
Are you one of those people that keeps track of... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
During the years of our consulting practice, which comes back... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
1. What determines the software price? Is it Per Seat... Read More
The various resume software offered, particularly on the internet, can... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
Microsoft Outlook is one of the most widely used software... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
Are you a database professional? Do you work with a... Read More
1. With mapping software you can create a report that... Read More
Software |