On Tue, 22 Dec 2009 07:36:42 -0600, Hunsicker, Brenda
<[login to unmask email]> wrote:
>Is anyone using SQLJ instead of JDBC for access to DB2 z/OS
from a Java
>program run on an intel box?
Yes. And frankly, for all cases where you have to actually code the
is my preferred way. Comes actually rather close to embedded SQL
used to do in the COBOL days (that are far from over, B.T.W.) There
is a little
extra burden in preparing the programs, but tools like RAD7 are
>How about the use of stored procedures or Java Beans executing
>program for access to DB2 z/OS?
Can be done. No sweat. Only, be aware of the overhead required to
call the stored procedure. If you call a stored procedure that then
runs for half
an hour and returns just one row; that's OK. But (and I have seen
and we are still working to get rid of the debris it caused...) do
not call a
stored procedure just to do a select of one column and then another
procedure to actually fetch one row...
The point is that calling a stored procedure is rather costly, just
invoke the procedure. If that is for doing a fair amount of work
database, then that is no issue, but if your stored procedure
indeed is doing
just a simple select, you will find the overhead of calling that
can be up to 500% of the cost of that select.
If that stored procedure then invokes a CICS transaction just to do
simple select, the picture becomes even more grotesk...
>We are looking at ways to improve the performance of our Java
Aren't we all?
>and we are considering a standard that states that DB2 z/OS
>via static SQL.
Static SQL in and of itself is not a guarantee of good performance.
dynamic SQL synonym of bad performance. Just make sure you have
tools that enable you to measure and tune.
It has to be said that, traditionally, in your average z/OS shop,
more tools are
available for dealing with static SQL than there are for dealing
>I am looking for pros/cons or any other advice that you can
>access to DB2 from Java via one of these methods - JDBC, SQLJ,
Have you considered using a Java persistency framework (things like
or Hibernate)? Correctly configured (and provided you let them
dynamic SQL), this can take a whole lot of coding burden off of
developers and the resulting SQL is not bad at all.
Make sure you obtain some tool for looking at and tuning your
Use the dynamic statement cache and hit your developers over the
when they forget to use parameter markers instead of actual
Use stored procedures for what they are meant to be used for and
encapsulate small, simple SQL.
* IDUG North America * Tampa, Florida, * May 10-14 2010 *
- with almost 150 IDUG Regional User Groups,
there is probably one near you!
Regional User Groups are your local connection to the Worldwide DB2
If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L
is the home of IDUG's DB2-L