Solved

calling java from DB2

Posted on 2003-11-07
4
751 Views
Last Modified: 2008-03-06
hi
   i'm having a java file and let's assume the class file is also with me.
how can i call the same java file from my stored procedure in DB2??
i mean i want to use methods of such java file in my stored procedure..

can anyone give me the complete steps.
it would be great if detailed steps can be stated.....

thanks
kabi satpathy
0
Comment
Question by:bkkabi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
BigSchmuh earned 300 total points
ID: 9717971
I am not very familiar with Java programming but I think you just need to do the following to be able to use a Java class from inside your DB2 proc.

You may define a function/proc which reference your external Java code.
I hope the following sample will be enough for you to define a reference to every needed of your Java functions.

CREATE PROCEDURE YourJavaFunc (IN aDouble DOUBLE, INOUT aInt INTEGER, OUT aChar20 CHAR(20))
DYNAMIC RESULT SETS 0
LANGUAGE JAVA
PARAMETER STYLE JAVA
NO DBINFO
FENCED
READS SQL DATA
PROGRAM TYPE SUB
EXTERNAL NAME 'YourClass.YourMethod'

Other kind of parameters are available:
"DYNAMIC RESULT SETS 1" if your Java class may returned data (There are some examples about this)
"MODIFIES SQL DATA" if your Java class makes modifications to data

Hope this helps.
0
 
LVL 18

Expert Comment

by:BigSchmuh
ID: 9718015
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question