wood burning stoves 2.0*
The moose likes JDBC and the fly likes Mapping Oracle DATE to java.sql.Date ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Mapping Oracle DATE to java.sql.Date ?" Watch "Mapping Oracle DATE to java.sql.Date ?" New topic

Mapping Oracle DATE to java.sql.Date ?

achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Hi I am getting inconsistent results in the the mapping.
Im the Oracle table, I have a date field which I retrieve using j2sdk1.4 getDate() method. Here is the code snippet from the applet :
import java.util.Date;
showHireDate(thisEmpRec.hiredate, HireDate);
public void showHireDate(Date hiredate, TextField HireDate)
{ HireDate.setText(hiredate.getDate() + "-" +
hiredate.getMonth() + "-" +
Sometimes, I get the correct display e.g. 21-12-91
Othertimes, I get odd results e.g. 21-7-102
I know it is deprecated, but it should work...

humanum errare est.
achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Wrong forum again, Dirk moves me around so fast I get dizzy.
I tried something new, but get my typical "cannot resolve symbol" error:

javac throws this error
cannot resolve symbol
symbol : method myDateFormat (java.util.Date)
location : class java.text.SimpleDateFormat
return formattedDate.myDateFormat(inputDate);

One would think I should get the hang of JAVA after 4 months of JAVA-ing, but, no...
achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
I spotted the error, should be

Thanks anyway.
I agree. Here's the link: http://aspose.com/file-tools
subject: Mapping Oracle DATE to java.sql.Date ?
Similar Threads
sql syntax for system date
JSP - JDBC alter column automatically
Objects and Constructs.
Representing MilliSeconds in JDBC using Oracle