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
move in cleaning service Mundelein ..The purpose of Project Management Software is to provide an... Read More
Are you a whiz at calculating financial information? Not the... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
Microsoft Outlook is one of the most widely used software... Read More
Vince Lombardi once said that, "The achievements of an organization... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
I have always regretted how Microsoft price gouges and rips... Read More
In this small article we will show you the possible... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
During the years of our consulting practice, which comes back... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
Siebel is traditional CRM market leader, however and mostly due... Read More
Linux essentials:It's free for download but you have to pay... Read More
If you use Microsoft Outlook (or similar applications) for e-mailing,... Read More
eStore Advantage allows front-office applications to communicate with back-office business... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
So let's begin crunching down these 300 images using Adobe... Read More
insured cleaning company Highland Park ..Have you noticed WordPerfect is gearing up for a comeback... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
XML parser is a software module to read documents and... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
What is Groupware?Have you ever had to manage document collaboration... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
Pirated software is on the increase and now accounts for... Read More
Sometimes your PC will start acting strange for no apparent... Read More
The stakes are high when considering security, privacy, and savings,... Read More
Now there are Three Steps To Heaven Just listen and... Read More
If you have been using the Internet for any amount... Read More
Which Type of Shop Can Rely On A Home Built... Read More
Using professional icons in your application or website can bring... Read More
Just when you thought you were Web savvy, one more... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
Software development is a risky business.Many software developers are barely... Read More
Music downloads are off the charts! We're listening to digital... Read More
Following tips help you to learn a software in lesser... Read More
To all web designers out there, this article is for... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
There are certain pluses and minuses in both cases and... Read More
MSN messenger is a pretty cool invention. I mean I'm... Read More
You might think you don't need a firewall... Read More
Software |