Performance Tuning of a Daffodil DB / One$DB -JDBC Application - myoddPc

Computer Information - myOddPc

Performance Tuning of a Daffodil DB / One$DB -JDBC Application

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 OverviewJDBC 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 interface4. Create a Statement5. Execute the Statement6. Retrieve results by using ResultSet interface7. Close Statement and ConnectionChoosing 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.htmlThis 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

Parveen Aggarwal

Sony PSP - Not Just For Games

Zen and the Art of Buying Computer Parts
The Ugly Face Of Technology
Wind Turbine Lights to Protect Birds
Robotic Manufacturing Lighting
Is that software really free?
Tips on Finding the Best CD Duplication Services
Making the Most of Digital Camera Memory Cards
Microsoft Dynamics GP & CRM in Transportation & Logistics
Computer Dos and Donts
Sony PSP - Not Just For Games

SyncUp – A File/Folder Synchronizer For Windows

Basic Tips and tricks for Windows XP
Buying the Perfect Computer – The FIRST Time
Dirty Little Computer Viruses and How To Protect Yourself
10 Secrets to a Healthy Computer and a Happier You
8 Simple Ways to Defend Against Evil Doers Both Online and Off
Microsoft CRM Programming Secrets – Tips For Developers
Microsoft Great Plains Integration with Legacy Systems – Overview For Developer
Microsoft RMS – Great Plains Integration – Overview For IT Specialist
Removing Incoming Email in MS Exchange, C# Example
SyncUp – A File/Folder Synchronizer For Windows

Articles by the same author

Reduce TCO: The Java Database Way
Why Java RDBMS?
Daffodil DB: Web Database
Performance Tuning of a Daffodil DB / One$DB -JDBC Application

Disclaimer

Please note that this website is for information only. Whilst every care has been taken to provide accurate information you should always seek the advice of a professional before attempting any repairs or making any purchase(s).
You need to take special care to ensure that the information given applies your system.

Google Adsense Tips & Tricks
Learn how to earn more with Google AdSense - Tips and Tricks - Free Application

Hen Do
Hen do parties and hen weekends across the UK
marker About Us | Site Map | Privacy Policy | Contact Us | ©2005-2006