Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-29531 Error - and the method is declared both PUBLIC and STATIC

Re: ORA-29531 Error - and the method is declared both PUBLIC and STATIC

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 11 Mar 2005 15:45:57 -0800
Message-ID: <1110584757.794110.322240@f14g2000cwb.googlegroups.com>

jfk2001 wrote:
> Could someone be of assistance and show me the problem with the
> following code? I have researched Metalink regarding ORA-29531, and
the
> most common cause of this error is the failure to declare the method
> "public" and "static". I have done both here and still have the same
> error:
>
>
> Java Code::::::::::::::::::::::::::­::::::::::::::::::::
>
>
> CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "TimeZoneFormatter"
AS
> import java.util.TimeZone;
> import java.util.Date;
> import java.text.DateFormat;
>
>
> public class TimeZoneFormatter {
>
>
> public static String Convert(String clientTimezone, Date clientDate)
> {
> //set the format for the dates
> DateFormat dateFormatter =
> DateFormat.getDateTimeInstance­(DateFormat.LONG, DateFormat.LONG);
> TimeZone timeZoneClient = TimeZone.getTimeZone(clientTim­ezone);
> // Set the time zone of the date formatter to Client time zone.
> dateFormatter.setTimeZone(time­ZoneClient);
>
>
> return dateFormatter.format(clientDat­e);
>
>
>
> }
> }
>
>
> ;
> /
>
> Wrapper Code::::::::::::::::::::::::::­:::::::::::::::::::::;
>
>
> CREATE OR REPLACE function TimeZoneFormatter (ClientTimezone
varchar2,
> ClientDate varchar2)
> return varchar2 as
> language java
> name 'TimeZoneFormatter.Convert(jav­a.lang.String, java.lang.String)
> return java.lang.String';
> /
>
>
> Test::::::::::::::::::::::::::­:::::::::::::::::::::::;
>
>
> select TimeZoneFormatter('Europe/Pari­s','Wed Mar 09 23:22:24 CST
> 2005')
> from dual ;
> *
> ERROR at line 1:
> ORA-29531: no method Convert in class TimeZoneFormatter
>
>
> Thank you very much in advance!
>
>
> Jeff
>
>
> Reply

You are using Date as 2nd parameter in your java source but passing varchar2 as 2nd parameter in your wrapper function.

  1. Change 2nd parameter in your wrapper function to Oracle Date type.
  2. Change 2nd java.lang.String to java.sql.Date in your wrapper function. Note: java.util.Date won't work.
  3. Change your import from java.util.Date to java.sql.Date in your java source.

Regards
/Rauf Received on Fri Mar 11 2005 - 17:45:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US