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

Home -> Community -> Usenet -> c.d.o.server -> Re: About Java Stored Procedure

Re: About Java Stored Procedure

From: Sameer <dolpheen_at_gmail.com>
Date: 12 Sep 2006 03:37:07 -0700
Message-ID: <1158057427.589369.162770@i42g2000cwa.googlegroups.com>


Dear Sir,
Just tell me how to deal with this NUMBER field which was stored as a date to retrieve the actual date and having date datatype so that queries can be fired.
As you said that java stored procedure is not required. -Sameer

sybrandb wrote:
> Sameer wrote:
> > One of the fields of a table is having NUMBER datatype.
> > The values stored in this field are the values represented using long
> > number representation of a date. [The long values represent the
> > specified number of milliseconds since the standard base time known as
> > "the epoch", namely January 1, 1970, 00:00:00 GMT.]
> >
> > A java function to convert this long value to string is:
> >
> > static String Long2String(long ldate) {
> > Calendar cal = Calendar.getInstance();
> > cal.setTimeInMillis(ldate);
> > int day=cal.get(Calendar.DAY_OF_MONTH);
> > int month=cal.get(Calendar.MONTH)+1;
> > int year = cal.get(Calendar.YEAR);
> > String strDate= day+"/"+month+"/"+year;
> > return strDate;
> > }
> >
> > I am new to Java Stored Procedure.
> > How to use this as a java stored procedure in the database.
> > Can I query the database using this function?
> > -sameer
>
>
> 1 You don't need a JSP for this purpose, as Oracle dates are expressed
> in DAYS, an you can add and subtract with (fractions) of dates
> 2 If you are new to JSP you need to read the documentation on JSP.
> You should NOT ask questions here.
> You have a history of asking RTFM questions, please stop being lazy.
>
> --
> Sybrand Bakker
> Senior Oracle DBA
Received on Tue Sep 12 2006 - 05:37:07 CDT

Original text of this message

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