1.

How Will You Optimize Performance In Jdbc?

Answer»

• Use batch transactions.
• Choose right isolation level as per your requirement.
TRANSACTION_READ_UNCOMMITED gives best performance for concurrent transaction based applications. TRANSACTION_NONE gives best performance for non-concurrent transaction based applications.
• Use PreparedStatement when you execute the same statement more than once.
• Use CallableStatement when you want result from multiple and complex statements for a single REQUEST.
• Use batch update facility available in Statements.
• Use batch retrieval facility available in Statements or ResultSet.
• Set up proper direction for processing rows.
• Use proper getXXX() methods.
• Close ResultSet, Statement and Connection whenever you finish your work with them.
WRITE precise SQL queries.
• Cache read-only and read-mostly tables data.
FETCH small AMOUNT of data iteratively rather than whole data at once when retrieving large amount of data LIKE searching database etc.

• Use batch transactions.
• Choose right isolation level as per your requirement.
TRANSACTION_READ_UNCOMMITED gives best performance for concurrent transaction based applications. TRANSACTION_NONE gives best performance for non-concurrent transaction based applications.
• Use PreparedStatement when you execute the same statement more than once.
• Use CallableStatement when you want result from multiple and complex statements for a single request.
• Use batch update facility available in Statements.
• Use batch retrieval facility available in Statements or ResultSet.
• Set up proper direction for processing rows.
• Use proper getXXX() methods.
• Close ResultSet, Statement and Connection whenever you finish your work with them.
• Write precise SQL queries.
• Cache read-only and read-mostly tables data.
• Fetch small amount of data iteratively rather than whole data at once when retrieving large amount of data like searching database etc.



Discussion

No Comment Found