473,320 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

table udf's and java

Hi all

I've been searching the Internet for a while and I've been trying to
find any resources on return tables using UDF's with Java. I've been
sucessful in returning integers, etc, but I have trouble finding
anything about return tables. Can such a thing be done in Java? If so,
can someone direct me to an example or have an example of implementing
such a thing. Or if there isn't, does anyone have a recommendation or
example on alternatives? Thanks

Nov 12 '05 #1
5 1790
jcccs05 wrote:
Hi all

I've been searching the Internet for a while and I've been trying to
find any resources on return tables using UDF's with Java. I've been
sucessful in returning integers, etc, but I have trouble finding
anything about return tables. Can such a thing be done in Java?
Yes, that's possible.
If so,
can someone direct me to an example or have an example of implementing
such a thing. Or if there isn't, does anyone have a recommendation or
example on alternatives? Thanks


What's your problem exactly?

(I just updated one of my articles to include a Java table UDF, but it's not
yet published.)

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2

"jcccs05" <jc****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi all

I've been searching the Internet for a while and I've been trying to
find any resources on return tables using UDF's with Java. I've been
sucessful in returning integers, etc, but I have trouble finding
anything about return tables. Can such a thing be done in Java?
Yes. The IBM manuals clearly show this. (You didn't say which version of DB2
you are using or what operating system you are running so I'm assuming that
you are using Version 8 of DB2 for Linux, Unix and Windows.)
If so,
can someone direct me to an example or have an example of implementing
such a thing.
Search your Info Center on "table UDF". There are discussions of the
concepts of a table UDF and the statements that are used to prepare a table
UDF. There are also some examples in the Samples part of the Info Center;
these samples are written in all or most of the languages that DB2 supports
for UDFs including Java.
Or if there isn't, does anyone have a recommendation or
example on alternatives? Thanks

Rhino
Nov 12 '05 #3
One thing to be careful about is not to PARAMETER STYLE JAVA if you
want to write Java table function. Stick with PARAMETER STYLE
DB2GENERAL.

Nov 12 '05 #4
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.

Nov 12 '05 #5

"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
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Abram Friesen | last post by:
Hi all, I'm a newbie at DB2 and trying to create a simple java UDF. When I call my function, I'm receiving SQL4306N. Could someone please tell me what I'm doing wrong here? Here is my java...
7
by: Rhino | last post by:
I was reading the DB2 for Linux/Unix/Windows (V7.2) manuals just now to get some background information about UDFs when I came across this: "Note that valuable debugging tools such as printf() do...
7
by: Rhino | last post by:
Since I haven't been able to find out yet how to get my Eclipse debugger to step through my Java UDF code, I am adding old-style File I/O debugging to some of my UDFs. I'm not sure of the best way...
4
by: Rhino | last post by:
I've been playing with Java UDFs for the last couple of days and I've got some questions about scratchpads. I'm running DB2 LUW V8 (FP8) on WinXP. Somewhere in the manuals, I found some remarks...
6
by: Rhino | last post by:
I am writing Java UDFs using DB2 V8.2 (Fixpack 8) on Windows XP. I would like to create some common code classes that are visible to the UDFs on my system but I'm not having a lot of luck so far....
3
by: gimme_this_gimme_that | last post by:
I'm driving Windows XP and could use a tip on installing a function written in Java. 1. I created the a Java jar file, named UdfUtils.jar, from the Java source file shown below: 2. I copied the...
6
by: Rhino | last post by:
I'm trying to debug a simple Java UDF written in the DB2General style within Eclipse. I'm getting a java.lang.UnsatisfiedLinkError when I execute the set() method in the UDF. I know that the...
8
by: gimme_this_gimme_that | last post by:
I have the following Java code : package com.rhi.bb.udf.utils; import java.sql.Clob; import java.sql.SQLException; import java.util.regex.Pattern; import java.util.regex.Matcher;
1
by: okonita | last post by:
Hello all, I have a Java problem that I hope can be answered here. Very new to DB2 UDB and UDF (we are on DB2v9.5, Linux and Windows), I have managed to get the UDF registered but having problem...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.