Well managed to get it working,
The problem was that the UDF couldn't find the activation.jar file.
Once I'd modified the CLASSPATH statement configured in db2profile and
restarted the instance it all worked.
Having said that, I thought that you either had to register the
referenced jar files via the call sqlj.install_jar command or add them
to the classpath statement and not both - or do I have to add an entry
to the classpath statement for "<instancehome>/sqllib/function/jar" if
i use the call command mentioned above?
Sean McKeough <mckeough@nospam.ca.ibm.com> wrote in message news:<bqflrg$n9$2@hanover.torolab.ibm.com>...[color=blue]
> 4302 often means either a java config problem, or a routine signature
> mismatch. You might want to up your diaglevel to 4, and try invoking the
> udf on its own...something useful might show up in the diag.
>
> Alex wrote:
>[color=green]
> > Well now got a setup where I can add stored procedures and user
> > defined functions and define a trigger ( It's actually from an article
> > in the DB2 magazine Volume 8 number 4 "Combining Triggers and UDFs" )
> >
> > The problem is that now when i try and execute an SQL command to run
> > the trigger which should run the UDF I get :-
> >
> > db2 => update booktable set quantity=8 where isbn=446310786
> > DB21034E The command was processed as an SQL statement because it was
> > not a
> > valid Command Line Processor command. During SQL processing it
> > returned:
> > SQL0723N An error occurred in a triggered SQL statement in trigger
> > "DB2INST1.TABLETR". Information returned for the error includes
> > SQLCODE
> > "-4302", SQLSTATE "38501" and message tokens
> > "DB2INST1.RESUPPLY|SQL031201144832600|java". SQLSTATE=09000
> > db2 =>
> >
> > Any help appreciated
> >
> > Alex
> >
> >
> >
A.Sharaz@hull.ac.uk (Alex) wrote in message news:<b270c055.0311240725.5d29007d@posting.google. com>...
> >[color=darkred]
> >>Anothe update
> >>
> >>Hi all,
> >>
> >>Well, on a test server i've managed to get some java stored procedures
> >>into the system.
> >>
> >>The small problem is that the system I want to do this on is currently
> >>running either j2sdk1.4.0_01 or a JVM called jrockit by a company
> >>called bea systems.
> >>
> >>Is anyone running a different jdk to the one supplied in
> >>/opt/IBMJava2-131 ?
> >>Alex
> >>
> >>A.Sharaz@hull.ac.uk (Alex) wrote in message news:<b270c055.0311200333.4e96d954@posting.google. com>...
> >>
> >>>Just an update.
> >>>
> >>>I've trawled the ibm site and found various documents on setting up
> >>>a Java environment on a linux system and *think* I've got the
> >>>path,classpath and ld_library_path variables set up correctly.
> >>>
> >>>This time I've uploaded a jar file into /usr/local/java/lib called
> >>>mail.jar and am trying to run call
> >>>sqlj.install_jar('file:/usr/local/java/lib/mail.jar','MAILJAR')
> >>>
> >>>having connected to the sample database
> >>>
> >>>I unfortunately get the same error as before i.e. SQL1042C and
> >>>SQLSTATE 58004
> >>>
> >>>Is ther any form of additional logging i can enable to find out
> >>>exactly what is going on when i run the sqlj.install_jar procedure?
> >>>
> >>>TIA
> >>>Alex
> >>>
> >>>
> >>>A.Sharaz@hull.ac.uk (Alex) wrote in message news:<b270c055.0311170910.59308fc5@posting.google. com>...
> >>>
> >>>>Hi all,
> >>>>I am trying to install a java stored procedure via the windows
> >>>>development centre.
> >>>>
> >>>>The linux box is running 8.1 FP4 as is the windoze platform. If I am
> >>>>on the linux box i can install the sample jdbc stored procedures o.k.
> >>>>
> >>>>For the purpose of this test I created a sample procedure that
> >>>>executes "select * from department" when conected to the sample
> >>>>database on the linux box.
> >>>>
> >>>>The connection to the server works o.k. but when it tries to
> >>>>build/install the stored procedure I get :-
> >>>>
> >>>>DB2INST1.PROCEDURE3 - Build started.
> >>>>C:\PROGRA~1\SQLLIB\java\jdk\bin\javac -classpath
> >>>>".;C:\PROGRA~1\SQLLIB\java\db2java.zip;C:\PROG RA~1\SQLLIB\java\runtime.zip;C:\PROGRA~1\SQLLIB\ja va\sqlj.zip"
> >>>>"PROCEDURE3.java"
> >>>>DB2INST1.PROCEDURE3 - Javac completed.
> >>>>C:\PROGRA~1\SQLLIB\java\jdk\bin\jar cf SQL31017050218310.jar
> >>>>PROCEDURE3.class
> >>>>DB2INST1.PROCEDURE3 - Jar file created.
> >>>>Call sqlj.install_jar ('file:///C|/Documents and
> >>>>Settings/alex/Application
> >>>>Data/IBM/DB2/DC/Projects/bld1069088558256/SQL31017050218310.jar',
> >>>>'"DB2INST1".SQL31017050218310', 0)
> >>>>[IBM][CLI Driver][DB2/LINUX] SQL1042C An unexpected system error
> >>>>occurred. SQLSTATE=58004
> >>>>
> >>>>DB2INST1.PROCEDURE3 - Build failed.
> >>>>DB2INST1.PROCEDURE3 - Roll back completed successfully.
> >>>>
> >>>>
> >>>>Now is is just a case of the created jar file not getting to the
> >>>>server? The aboe almost looks as if sqlj.install_jar on the linux box
> >>>>is trying to access a jar file on the windoze platform
> >>>>
> >>>>While I *could* do all this from a cli on the linux box, it does seem
> >>>>a bit easier to use the development centre.
> >>>>
> >>>>Trawling through the information centre I did find some comments about
> >>>>setting up classpath ld_library_path etc and I think I have done that
> >>>>o.k.
> >>>>
> >>>>Any help appreciated
> >>>>
> >>>>Alex[/color][/color][/color]