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
Wood Dale Chicago prom limo .. Lockport Chicago limo O’HareAre you lost in the mess of documents that get... Read More
1. With mapping software you can create a report that... Read More
Did you ever give a thought to the number of... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Microsoft Great Plains and Microsoft CRM become more and more... Read More
In this small article we will show you the possible... Read More
Pirated software is on the increase and now accounts for... Read More
Executive SummaryAn effective plan for entering, cleaning and updating the... Read More
CD and DVD replication is a process that works by... Read More
Icons are used everywhere; right from software applications, to internet... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
Let us give you - developer some hints in the... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
This article will not attempt to advocate the use of... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
The various resume software offered, particularly on the internet, can... Read More
Ad-Aware and Spybot are probably the two most well known... Read More
Did you ever want to erase everything on your computer?... Read More
Microsoft Business Solutions Great Plains has many years of successful... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Now that spyware is the single most dangerous threat to... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
Antigo wedding limo ..Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
Our opinion is based on our Microsoft Business Solutions Great... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Whether you need to close a sale, gather end-user feedback,... Read More
Looking at all the ads which promise to get rid... Read More
Three highly respected names in Human Resources have joined forces... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
In the early days of the personal computer, we're talking... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
It is really interesting that a bug can create problem... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
If you've been using MySQL database to store your important... Read More
Usually, the easiest way to tell you have spyware is... Read More
The Windows registry is a huge database that ensures normal... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
You turn on your computer, and it doesn't look quite... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
Stealing company information used to be the specialty of spies... Read More
Software |