J2EE application programming tips
These programming tips relate to the following topics:
- JavaServer pages (JSPs)
- Java Database Connectivity (JDBC)
- Make sure you are at the current JDBC level.
- Use prepared statements to allow dynamic statement cache of DB2 on z/OS.
- Don't include literals in the prepared statements, use a parameter marker
"?" to allow dynamic statement cache of DB2 on z/OS.
- Use the right getxxx method by each data type of DB2.
- Turn auto commit off when just read-only operations are performed.
- Use explicit connection context objects.
- When coding an iterator, you have a choice of named or positioned. For
performance, we recommend positioned iterators.
- Close prepared statements before reusing the statement handle to prepare
a different SQL statement within the same connection.
- As a bean developer, you have the choice of JDBC or SQLJ. JDBC makes use
of dynamic SQL whereas SQLJ generally is static and uses pre-prepared plans.
SQLJ requires an extra step to create and bind the plan whereas JDBC does
not. SQLJ, as a general rule, is faster than JDBC.
- With JDBC and SQLJ, you are better off writing specific calls that retrieve
just what you want rather than generic calls that retrieve the entire row.
There is a high per-field cost.

Developing J2EE application client code
Searchable topic ID:
rprf_tunezapp
Last updated: Jun 21, 2007 9:56:50 PM CDT
WebSphere Application Server for z/OS, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/rprf_tunezapp.html