"jcccs05" <jc****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I am using version 8 of DB2 under windows. I found the samples under
the samples part of the info center. I was wondering if there are any
other resources that help to further explain what is exactly going on
and how the client interacts with the server in the sample as well as
how the scratchpad is exactly working. Thanks for the help.
I don't work in the IBM lab so I don't have any "inside" knowledge. However,
you can learn a bit more by using System.out.println() statements to write
to a flat file within your UDFs. Then try making changes to the examples to
see what works and what doesn't.
As far as I can tell, the documentation describing the "Table function
processing model" is accurate and should give you reasonable insight into
what is happening. The System.out.println() statements that you add to your
code should confirm what you see in the manuals.
With regards to the scratchpad, the sample programs show setScratchpad() and
getScratchpad() being used with streams but, so far, I've found that an
ordinary class variable works just as well without all the bother of reading
and writing byte streams. The manual mentions that both can be used, which
is what inspired me to try it in the first place.
As usual with DB2, the manual doesn't tell you everything you might like to
know. For instance, I can't find anything that says categorically whether
this is any real risk to using class variables rather than
getScratchpad()/setScratchpad() in UDFs. By the same token, I can't find any
categorical statement that says that you can or cannot access other non-UDF
Java classes from your UDF. For questions like this, you can try posting to
this newsgroup and asking but you may not get a categorical answer from IBM,
just an educated guess from another user like yourself.
Another resource that might be useful is the DeveloperWorks site, which is
accessible from the IBM site. Some of the articles there are quite
interesting; I'm just reading one on combining a trigger, a UDF and JavaMail
to send an email to a customer when their credit card purchases are
approaching their credit limit.
Rhino