How to call java program in the SQL function
Posted in 2010
Topics: Java & JDBC Development
Hi, How to call a java class in a Informix SQL function? the previous application write a Oracle sql function to call a java program, Do anyone show a sample or more detail information for me in Informix? thanks for your time.
CHUAN LU wrote: > Hi, > > How to call a java class in a Informix SQL function? the previous application > write a Oracle sql function to call a java program, Do anyone show a sample or > more detail information for me in Informix? > thanks for your time. http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.jfoun.doc/si i04udr987897.htm -- Cheers, Obnoxio The Clown http://obotheclown.blogspot.com I will now proceed to pleasure myself with this fish. -- This message has been scanned for viruses and dangerous content by OpenProtect(http://www.openprotect.com), and is believed to be clean.
On Tue, Sep 14, 2010 at 4:23 PM, CHUAN LU <luchuan114@sina.com> wrote: > Hi, > > How to call a java class in a Informix SQL function? the previous > application > write a Oracle sql function to call a java program, Do anyone show a sample > or > more detail information for me in Informix? > thanks for your time. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > If you want to execute a java _program_ you can use the SYSTEM spl function. But technically you can also use the java code to create a Java function that will run "inside" the engine. Just as a normal stored procedure would do. This is documented in the UDR (User Defined Routines) manual. I personally don't like to use SYSTEM except for very specific cases.... I have some objective reasons for that and some subjective... Please consider the options and if you need more specific help please say so. Regards. -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --0015175cb54290fba4049039f521
Are you asking how to call a Java language User Defined Function - as opposed to a stored procedure written in SPL or a User Defined Function written in "C" or how to execute an external program writen in Java? The answer to the former is that you would call it just like any other UDR or Stored Procedure with the EXECUTE verb or as part of an SQL DML statement. The answer to the latter, is that you would execute it just like any other external interpreted program with the SYSTEM command. So if you would run the Java program on the commandline with: java -jar myjarfile.jar You would execute it from SPL using: SYSTEM "java -jar myjarfile.jar"; Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Sep 14, 2010 at 11:23 AM, CHUAN LU <luchuan114@sina.com> wrote: > Hi, > > How to call a java class in a Informix SQL function? the previous > application > write a Oracle sql function to call a java program, Do anyone show a sample > or > more detail information for me in Informix? > thanks for your time. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --0016361e7bb23cf71d04903a4fa9
Thanks for your suggestion, I have find the sample code.