Go Back   Rhinocerus > Newsgroup > Newsgroup comp.databases.* > Newsgroup comp.databases.informix

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 04-05-2006, 03:49 PM
petereakin@gmail.com
Guest
 
Posts: n/a
Default Informix - Trigger a java class

Hi all

Just wondering if it is possible to trigger a java class from informix.

The scenario is that I want to have a print queue table and once a
record is inserted in the table informix should trigger the java class.
This class will use the data in the print queue table and look up other
tables to find information needed to print the document.

Can this be done, if so how?
Peter

Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 04-05-2006, 06:12 PM
keshava.news@gmail.com
Guest
 
Posts: n/a
Default Re: Informix - Trigger a java class

You can create procedures/functions in Informix mapping
them to Java classes. See the manual for details on setting
Informix to run java procedures and using them.
http://publib.boulder.ibm.com/infoce....doc/jfoun.htm

CREATE FUNCTION PrintAction(int a , lvarchar b)
WITH (CLASS="jvp")
EXTERNAL NAME 'FirstUDR.Add(java.lang.integer, java.lang.String)'
LANGUAGE java;

CREATE TRIGGER tab1instrig INSERT ON tab1
REFERENCING NEW as new
FOR EACH ROW (EXECUTE PROCEDURE PrintAction(new.id, new.info));


Within FOR EACH ROW or AFTER section of INSERT trigger,
simply execute this procedure or function to run the Java code.

cheers,

Keshav.

Reply With Quote
  #3 (permalink)  
Old 04-05-2006, 06:12 PM
keshava.news@gmail.com
Guest
 
Posts: n/a
Default Re: Informix - Trigger a java class

You can create procedures/functions in Informix mapping
them to Java classes. See the manual for details on setting
Informix to run java procedures and using them.
http://publib.boulder.ibm.com/infoce....doc/jfoun.htm

CREATE PROCEDURE PrintAction(int a , lvarchar b)
WITH (CLASS="jvp")
EXTERNAL NAME 'FirstUDR.Add(java.lang.integer, java.lang.String)'
LANGUAGE java;

CREATE TRIGGER tab1instrig INSERT ON tab1
REFERENCING NEW as new
FOR EACH ROW (EXECUTE PROCEDURE PrintAction(new.id, new.info));


Within FOR EACH ROW or AFTER section of INSERT trigger,
simply execute this procedure or function to run the Java code.

cheers,

Keshav.

Reply With Quote
  #4 (permalink)  
Old 04-06-2006, 07:51 AM
pete
Guest
 
Posts: n/a
Default Re: Informix - Trigger a java class

Thanks for the reply

Is there a way to run a java program which isn't a UDR, i.e. it doesn't
have to be installed in the database server? The code you provided
above is exactly what I need only I want my java code to be located
somewhere else on the same box.

Thanks
Peter

Reply With Quote
  #5 (permalink)  
Old 04-08-2006, 01:46 AM
david@smooth1.co.uk
Guest
 
Posts: n/a
Default Re: Informix - Trigger a java class


pete wrote:
> Thanks for the reply
>
> Is there a way to run a java program which isn't a UDR, i.e. it doesn't
> have to be installed in the database server? The code you provided
> above is exactly what I need only I want my java code to be located
> somewhere else on the same box.
>
> Thanks
> Peter


The only other way is to convert it into a program that can be run from
the
command line and use the SYSTEM command inside a stored procedure.

Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to check, if a Java Class exists out of sas data step Michael Weiss Newsgroup comp.soft-sys.sas 0 06-12-2007 06:47 AM
How to check, if a Java Class exists out of sas data step Michael Weiss Newsgroup comp.soft-sys.sas 1 06-11-2007 11:16 AM
Re: Equivalent of the "Rollup" SQL function in SAS (and Jack Hamilton Newsgroup comp.soft-sys.sas 0 05-18-2005 04:37 AM
Re: Equivalent of the "Rollup" SQL function in SAS (and the CUBE nospam@HOWLES.COM (Howard Schreier Newsgroup comp.soft-sys.sas 0 05-17-2005 03:43 PM
Re: Question: How does one move from SAS to Java? owner-sas-l@LISTSERV.UGA.EDU Newsgroup comp.soft-sys.sas 0 11-22-2004 02:16 PM



All times are GMT. The time now is 11:57 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.