Home » Developer & Programmer » JDeveloper, Java & XML » How do I pass Oracle sysdate to a Java stored procedure
How do I pass Oracle sysdate to a Java stored procedure [message #92173] Thu, 01 April 2004 10:58 Go to next message
Dan Riesland
Messages: 1
Registered: April 2004
Junior Member
-- How do I pass the Oracle sysdate to a Java stored procedure and display the results ?

-- Why won't this work ?

create or replace and compile

java source named "SeeSysdate"

as

import java.sql.Timestamp;

import java.text.ParseException;

public class SeeSysdate extends Object

{

public static String displayDate(java.sql.Timestamp date) throws ParseException

{

String dateTime = date.toString();

return dateTime;

}

}

/

create or replace

function show_date return varchar2

as language java

name 'SeeSysdate.displayDate(java.lang.Timestamp) return java.lang.String';

/

show errors

select show_date(sysdate) from dual;
Re: How do I pass Oracle sysdate to a Java stored procedure [message #92230 is a reply to message #92173] Mon, 26 April 2004 20:45 Go to previous message
ajay gupta
Messages: 13
Registered: July 2003
Junior Member
Please make a change in show_date function. You have missed the input parameter to the function.

create or replace function show_date(udate date) return varchar2
as language java
name 'SeeSysdate.displayDate(java.sql.Timestamp) return java.lang.String'
/

Hope this works
Ajay Gupta.
Previous Topic: Stale JDBC Connections
Next Topic: need info on ORA-01013 error.
Goto Forum:
  


Current Time: Sat Jul 24 16:19:21 CDT 2021