Solved

calling java from DB2

Posted on 2003-11-07
4
739 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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 (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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