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
reliable maid service Highland Park ..And kill the best layout software in the process of... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
Remember back in the days where screensavers were the coolest... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
Internet worms. Is your PC infected?If your computer has become... Read More
Following tips help you to learn a software in lesser... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
1. What determines the software price? Is it Per Seat... Read More
Buying accounting software is a major investment. It's an important... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
Every day millions of new web documents emerge on the... Read More
During the years of our consulting practice, which comes back... Read More
Anti-virus software is used to find, remove or fix files... Read More
So, why should you use any O/R mapping tool? I... Read More
After seeing many people complain about their weak Internet security... Read More
Designing without tables by using CSS layouts is fast becoming... Read More
Microsoft Business Solutions Great Plains was designed back in the... Read More
When you visit department stores and see that majority of... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
The most important benefit of XML is its simplicity. Though... Read More
Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
We are in a transition phase in the Managerial Administration... Read More
house cleaning company Lincolnshire ..While I was preparing some personal background information for a... Read More
Not every software testing project can or should be automated.... Read More
How would you like to prevent spyware and adware from... Read More
Microsoft CRM is now on the scene and it is... Read More
Once upon a time not so long ago, there was... Read More
Around the same time Microsoft made its move with .Net... Read More
The vast majority of us will have, at some point,... Read More
TikiWiki is open source software - it is written in... Read More
Microsoft CRM customization techniques are very diversified and based on... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
The fact that a software tester is a most infamous... Read More
Microsoft Business Solutions Great Plains as new ERP for multinational... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
The Internet is reshaping every form of communications medium, and... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
The purpose of one of our projects was MS Exchange... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
Domino server is a buffer between the operation system and... Read More
It is possible that if one avoided all sources of... Read More
Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
Microsoft CRM is CRM answer from Microsoft Business Solutions. If... Read More
Looks like Microsoft Great Plains becomes more... Read More
Software |