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
Cadillac Deville rentals Bingham .. Lockport Chicago limo O’HareAre Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Program Flow is what you think it is. How the... Read More
Microsoft Business Solutions Great Plains is Dexterity-written application and currently... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
Lotus Notes Domino is very efficient in electronic document workflow... Read More
Whether you have used Microsoft Word for years, have just... Read More
It is really interesting that a bug can create problem... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More
We'll give you non formal view, based on our consulting... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
Microsoft Business Solutions Great Plains is very generic accounting application... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
How would you like to prevent spyware and adware from... Read More
We would like first emphasize the change in the paradigm.... Read More
CD and DVD replication is a process that works by... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Fundraising software lets you connect with donors in a way... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Sales are all about leverage, because there is only so... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
Linux essentials:It's free for download but you have to pay... Read More
limo rental Des Plaines ..Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
Microsoft Great Plains serves majority of US based horizontal and... Read More
Spyware and Adware infest over 90 percent of computers in... Read More
In this article you will find some background information about... Read More
The intuitive algorithm.Roger Penrose considered it impossible. Thinking could never... Read More
Microsoft Great Plains, Navision, Solomon and Axapta are Microsoft Business... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
We all already got used to computer monitoring both at... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
Microsoft CRM is new player on the CRM software... Read More
Spyware is like the new technological nuclear weapon on the... Read More
Most people understand that the "hardware" part of their computer... Read More
Lotus Notes Domino is very efficient in electronic document workflow... Read More
Your computer cost you from hundreds to thousands of dollars,... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Does Microsoft care for WebmastersIt's always been a problem with... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
Great Plains Accounting, accounting package for mid-size and small companies... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
Microsoft Business Solutions products: Great Plains, MS CRM, Navision, Axapta,... Read More
Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
CD and DVD replication is a process that works by... Read More
Microsoft has never released a service pack for Windows98 SE,... Read More
Great Plains Integration Manager scripting and translation - overview for... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Software |