jdbc and dates
843854Nov 26 2001 — edited Nov 27 2001i have a question regarding dates:
in my java program i created the following sql String:
INSERT INTO RESERVATIE VALUES(1,10,to_date('1987/05/31:12:00:00AM','yyyy/mm/dd:hh:mi:ssam'),to_date('1998/05/31:12:00:00AM','yyyy/mm/dd:hh:mi:ssam'),'Vettigen','Dre')
stmt.executeUpdate(sql);
con.commit();
this works fine.
Now i want to retrieve the "dateString" somewhere else in the program.
for example:
sql="SELECT * FROM table_name";
Statement stmt= con.createStatement();
ResultSet rst = stmt.executeQuery(sql);
while(rst.next()){
String myDate = rst.getString(3);
}
now if i print the String object myDate i get : 1998-05-31: 00:00:00.0
It seams that i lost the hour/minutes/seconds fields. How can i get them from the Oracle db?
thx