Best Practices

Some of the best practices are already built-in the JDBC API itself, such as connection pooling, PreparedStatement, and batch updates. Still some of the widely known practices help when developing large and enterprise J2EE applications.

Some factors affecting the performance of your application with respect to database are independent of JDBC or any other access method. Examples of such factors are writing optimized queries, and tuning the database using caching of often-used resources. Both database tuning and query optimization are beyond the scope of this book. A simple example such as using the query "SELECT * from Student” rather than "SELECT id from Student" when you need only the student IDs, increases network traffic and ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.