Other Important Points to Remember

There are some other points not specific to a particular technique that you should know and incorporate into your programs. These include limiting ResultSet size and doing your own transaction management.

Limit ResultSet Size

I said earlier that JDBC 2.0 allows you to get the number of rows in a ResultSet. You should use this information to limit the amount of data you send to a client. Let's say that your middle-tier database access code (tier two is where this code belongs) makes a call and returns 10,000 rows. Realistically (even if your user's system can hold that much data, and you don't mind the download time required to copy it to the client system), the user is not going to read 10,000 rows worth of ...

Get PURE Java™ 2 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.