× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

Your CREATE FUNCTION is different as mine !

The parameter style should be "java" instead of "db2general" ! (unless you
take other considerations as explained on the link you mentioned in your
previous posts).

Kind regards,
Paul

----- Oorspronkelijk bericht -----
Van: Sultan yılmaz [mailto:yilmazsultan@xxxxxxxxx]
Verzonden: woensdag, juli 11, 2007 10:29 AM
Aan: 'Java Programming on and around the iSeries / AS400'
Onderwerp: Re: trigger call java class

Hİ,

Unfortunately it does not work.I try the way that mentioned in your
mail.But i does not work.
the following error occured:

[SQL4304] Java stored procedure or user-defined function PROPER, specific
name PROPER could not load Java class TSTUDF for reason code 2.


Details:

create function proper(VARCHAR(255),VARCHAR(255))
returns varchar(255)
external name 'TSTUDF.JVMORCL' language java
parameter style db2general fenced no sql
disallow parallel scratchpad

SELECT proper('test','test') FROM SYSIBM.SYSDUMMY1 AS A

*

public* *class* TSTUDF {

*public* *static* String JVMORCL(String property, String value)
*throws*Exception
*{*

*....*

*}*

I read mails,forums,red books.But i can't solve problems.

I can run only table funtion with no parameters.But i has to run it with
parameters.

what can i do?

Sultan








On 7/10/07, Paul Nicolay <Paul.Nicolay@xxxxxxxxxx> wrote:

Hi,

You can pass parameters by defining them on the CREATE FUNCTION.

For example;

create function MyUDF(varchar(255), varchar(255))
returns varchar(255)
external name 'JavaUDF.TestUDF' language java
parameter style java fenced no sql
disallow parallel scratchpad

.. with...

public class JavaUDF {

public static String TestUDF(String s1, String s2) {

return s1.concat(s2);
}

}

... works fine as select MyUDF('abc', 'def') from pn/onerow

If a combination with returning a table works is something I haven't
tried.

Kind regards,
Paul

----- Oorspronkelijk bericht -----
Van: Sultan yılmaz [mailto:yilmazsultan@xxxxxxxxx]
Verzonden: dinsdag, juli 10, 2007 10:48 AM
Aan: 'Java Programming on and around the iSeries / AS400'
Onderwerp: Re: trigger call java class

Hi again,


http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzaha/udftable.htm

There is a sample function and java class in this link.
And public void dump (String property, String value) methods have two
parameters.
And i call function like this :SELECT * FROM TABLE(PROPERTIES())

Why i don't call function like PROPERTIES('sample','test') with
parameters?

is it possible?I want to send parameter to my java method.But how?


Sultan





--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.