How do I pass Oracle sysdate to a Java stored procedure [message #92173] |
Thu, 01 April 2004 10:58 |
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;
|
|
|
|