Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Externals and PLS-00311
Actually, I finally managed to call Java's static method from PL/SQL.
Code has nothing wrong. There are quite many other task to do
when Java class's static method is called from PL/SQL.
Unfortunately, Oracle's document does not say a much.
"Frank van Bortel" <frank.van.bortel_at_gmail.com> wrote in message
news:1159259467.912825.67410_at_i3g2000cwc.googlegroups.com...
>
> JimmyD schreef:
>
>> I have a following Java class
>>
>> package com.firm.service;
>>
>> public class JavaExtService
>> {
>> private static String serviceName = "This is service name";
>>
>> public JavaExtService()
>> {}
>>
>> public static String getServicenName()
>> {
>> return serviceName;
>> }
>> }
>>
>> and I'm trying to create a function using it with command below
>>
>> CREATE or REPLACE FUNCTION getExternalService
>> RETURN VARCHAR2
>> AS LANGUAGE JAVA
>> NAME 'com.firm.service.JavaExtService.getServiceName() return
>> java.lang.String';
>>
>> But Exception PLS-00311 is thrown
>> " the declaration of "com.firm.service.JavaExtService.getServiceName()
>> return java.lang.String" is incomplete or malformed "
>>
>> Can anyone see what could be wrong?
>
> Not being a Java programmer at all, I do think you cannot
> use a class in a PL/SQL function - you can call a java
> function, but not a class.
>
Received on Tue Sep 26 2006 - 13:18:37 CDT
![]() |
![]() |