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 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 parveenaggarwal@hotmail.com
|
|
|
The Importance Of Timely Timesheets
Whether you are a small consultancy firm, a medium sized accountancy practice, or a code warrior for hire in a back room of your house then you have at least one thing in common: you are in business to get paid quickly, and for the work you have done. Timesheets are the usual method for tracking time you spent working and thus are the key to timely invoice generation. Timely invoice generation and despatch is impo...(related: Software)
Spyware, Adware, Etc. -- Terms And Common Sense
When reading an article where some term is used often, it is useful to make sure the author of the article and you mean the same. Not surprisingly for those who still remember English lessons at school, every noun ending with "ware" is a mixture of objects having something in common--usually used for similar purposes. So it tends to be when "ware" is short for "software"; sometimes it's pretty tricky ...(related: Software)
Passwords Used In Microsoft Word Documents
You would like to protect your documents, wouldn't you? Reasons may vary but the problem is the same ? you need to protect your Microsoft Word documents from unauthorized editing or viewing. What document protection features does Microsoft® Office Word 2003, a part of Microsoft Office Professional Edition 2003 provide?Microsoft Word features for document protection. Microsoft Word offers t...(related: Software)
Linux Vs. Windows
This article will not attempt to advocate the use of Linux over Windows or vice versa. I will try to present the differences and similarities between Linux and Windows in a fair manner.Overview:Both Linux and Windows ...(related: Software)
Guide To Software Marketing
IntroThis concise article will tell you in plain English how you can promote your software easily and effectively.Submit your softwareI recommend submitting your software to upload.com. It costs $79 dollars a year, but is well worth it. It will display your product on download.com and its partner network made up of 20 other major download sites. Download.com is so popular that if your product was only listed on download.com it would still be worth the yearly fee.Use Rudenko's (submit.rudenko.com) software submission service to submit your software to hundreds of software archives. Unlike auto-submit programs, Rudenko has employees manually submit your software to each archive so it is l...(related: Software)
Crystal Reports For Microsoft Rms ? Overview For Developer/report Designer
If you are software developer or database administrator - we would like to give you the clues on Crystal Report creation for Microsoft RMS
Microsoft Ecommerce Web-development: Great Plains Econnect .net ? Highlights For Programmer
In our small article we'll consider Microsoft Business Solutions Great Plains Sales Order Processing module as eCommerce backend. Plus we'll cover what is possible and impossible in eConnect and why.Microsoft Great Plains is one of the most popular ERP in the US, Canada, Australia, New Zealand, Middle East, Latin America, UK and South Africa. Due to the MBS strategy ? Great Plains Dynamics was pulled from other markets, such as continental Europe (Germany, France, Russia) ? where Navision and Axapta are the promoted and recommended solutio...(related: Software)
5 Easy File Management Tips In Microsoft Word
How many steps does it take you to locate and open your Word documents? Try these tricks to streamline how you find and open the files you use most often:Opening DocumentsWith a variety of choices, how do you open a file? Here are the standards plus several keyboard shortcuts:? File > Open? Open toolbar button (usually 2nd from the left on the Standard toolbar)? [Ctrl] + O? [Ctrl] + F12? [Ctrl] + [Alt] + F2Selecting More Than One FileOnce you are in the Open dialog box, select more than one file to open:? To select nonadjacent files in the Open dialog box, click one file, and then hold down [Ctrl] and click each additional file.? To select adjacent files in the Open dialog box, click the first file in the sequence, and then hold down ...(related: Software)
Recent Studies Show That 9 Out Of 10 Pcs Are Infected With Spyware
Spyware and malware are large problems for Internet users today and can be both annoying and a real threat to you and your computer. There exist a number of different spy and malware of which some are relatively friendly and only sp...(related: Software)
Microsoft Crm Implementation For Large Corporation ? Overview
Microsoft Business Solutions CRM is now approaching the phase of being mature product and the CRM solution you may consider for large publicly traded company. Our view point considers the fact of multiple platforms and systems coexistence and balancing: UNIX, Linux, Microsoft Windows, Java, .Net, PC, AS/400, RS6000, Microsoft Exchange, Lotus Notes Domino, etc. This increases the c...(related: Software)
site-map - Copyright © 2008 | Contact Webmaster | All Rights Reserved. | Software