J2EE Checklists – 5

1. Check whether row pre fetch value has been used or not

2. Check whether connection being got from pool.To be specific check whether connection object been got from datasource

3. Check whether Result set,Statement, Prepared and Callable Statement and connection been closed in the finally block

4. Make sure Auto commit been set false.Keeping auto commit set true virtually makes the commit operation after every statement of execution

5. Use prepare statement,check whether prepared statement has been used or not

6. Check what transaction isloation level has been set?

7. Use getXXX(“column index”) instead of getXXX(“Column Name”)

8. Avoid expensive database query functions such as: getBestRowIdentifier; getColumns; getCrossReference; getExportedKeys; getImportedKeys; getPrimaryKeys; getTables; getVersionColumns

9. CachedRowSet provides cached result sets that do not require continuous connection to the database, allowing connections to be reused more efficiently.

10.      Using CachedRowSet lets you batch updates, and execute them asynchronously.

11. CachedRowSet also supports offline work that is later synchronized.

12. CachedRowSet is probably not appropriate for managing large datasets.

13.      Store character data in DB2 as Unicode

14. Store numeric data in DB2 as float

15.      Do batch update where ever it is possible

16.      Cache read-only and read-mostly tables data

17.      Always catch and handle database warnings and exceptions

18. Use in-place updates, i.e. change data in rows/tables that already exist rather than adding or deleting rows/tables. Try to avoid moving rows or changing their sizes

19. Use a parametrized remote procedure call (RPC) rather than passing parameters as part of the RPC call, e.g. use Connection.prepareCall(“Call getCustName (?)”).setLong (1,12345) rather than Connection.prepareCall(“Call getCustName (12345)”)


Leave a comment

0 Comments.

Leave a Reply

  • Read this materials also:
  • J2EE Checklists – 6
  • J2EE Checklists – 7
  • J2EE Checklists – 4
  • J2EE Checklists – 1
  • J2EE Checklists – 3
  • JDBC Interview Questions -2
  • J2EE Checklists – 2
  • JDBC Interview Questions -1
  • JDBC Interview Questions -5
  • JDBC Interview Questions -4
  • Sitemap   Follow j2eetutorial on Twitter    

    Δ Top