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
![]() |
|
![]() |
|
![]() |
|
![]() |
The first topic we are going to discuss... Read More
Homeland security, airport security, Internet security â?" these days weâ??re... Read More
One day, you suddenly realize that your computer started to... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
Three highly respected names in Human Resources have joined forces... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
What is installation in the language of technology? Installation... Read More
In the previous ISDN article, we looked at how and... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
An integral part of any quality CRM system is lead... Read More
Every day millions of new web documents emerge on the... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
Make-or-Break Factors in Success and ProfitabilityFor quick printers, estimating can... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
There is many things more frustrating than surfing a website... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
Whether you are a small consultancy firm, a medium sized... Read More
Currently Microsoft Business Solutions is on the way of creating... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
Disclaimer: All the thoughts expressed are my views only! Your... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
With thousands of web pages added to the Net every... Read More
Should one use Windows Update?This topic has good and valid... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Adobe Photoshop is one of the world's leading graphics editing... Read More
Microsoft has never released a service pack for Windows98 SE,... Read More
Microsoft Great Plains is main mid-market application from Microsoft Business... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
Vince Lombardi once said that, "The achievements of an organization... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
Executive SummaryAn effective plan for entering, cleaning and updating the... Read More
All of us know that Microsoft bought former Great Plains... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Once upon a time not so long ago, there was... Read More
The stakes are high when considering security, privacy, and savings,... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
Since technology changes so quickly, it is hard to begin... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
If you would like to pick something from Microsoft, or... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Business Solutions Great Plains, Navision, Axapta, Solomon and CRM... Read More
It won't matter how effective your WinRunner Team is if... Read More
If you are in the market for new staffing software,... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
While I was preparing some personal background information for a... Read More
Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
Usually workflow & messaging is realized in CRM and then... Read More
Customer Relationship Management or CRM is a combination of enterprise... Read More
This article illustrates the best practices to improve the performance... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Microsoft Great Plains - Microsoft Business Solutions accounting and ERP... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Microsoft Business Solutions ? Navision is an integrated solution for... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
Using professional icons in your application or website can bring... Read More
If your company has regional and worldwide operations, you might... Read More
Many Webmasters have never bothered to view their website's server... Read More
Software |