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
ohare limo service Grand Rapids ..When you visit department stores and see that majority of... Read More
The Windows Indexing Service provides you with the ability to... Read More
I love new technology. I am still ready to wait... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
Navision Software was purchased by Microsoft and now it is... Read More
So, why should you use any O/R mapping tool? I... Read More
Linux essentials:It's free for download but you have to pay... Read More
Cyberspace has opened up a new frontier with exciting possibilities... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
Anti-virus software is used to find, remove or fix files... Read More
Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
Case study: A secretary using Corel WordPerfect 7 is often... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
One day, you suddenly realize that your computer started to... Read More
Microsoft Business Solutions Great Plains has Project Accounting module where... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Microsoft CRM is now on the scene and it is... Read More
Microsoft Business Solutions Great Plains, Solomon, Navision, Axapta, Microsoft CRM... Read More
When you first think about multicurrency ? you probably have... Read More
Microsoft Great Plains, designed back in 1990th as database transferable... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
Assertion facility is added in J2SE 1.4. In order to... Read More
Following tips help you to learn a software in lesser... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
executive chauffeured services Barrington Hills ..Since technology changes so quickly, it is hard to begin... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
I like my software simple. If it's too complex or... Read More
Once a business idea is selected, it is highly recommended... Read More
The purpose of Project Management Software is to provide an... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
With any good luck and a good amount of hard... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
When reading an article where some term is used often,... Read More
Icons are used everywhere; right from software applications, to internet... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
XML parser is a software module to read documents and... Read More
There are two major WYSIWYG(What You See Is What You... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
In part III of this ISDN primer, we learned that... Read More
Enabling Chinese input is quick and easy, there are only... Read More
Just the thought of a duel-boot scares many people away,... Read More
Following tips help you to learn a software in lesser... Read More
Current Microsoft Business Solutions Great Plains has more that 10... Read More
Although statistics often is blamed for various deadly sins --... Read More
This tutorial covers OLAP solutions used by Data warehouses and... Read More
We all already got used to computer monitoring both at... Read More
Software |