This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes why what i search is not what i want? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "why what i search is not what i want?" Watch "why what i search is not what i want?" New topic
Author

why what i search is not what i want?

simplex du
Greenhorn

Joined: Mar 25, 2002
Posts: 24
i use java+Oracle.
when i insert my date into my table,i write a serials of SQL as following:
insert into mytable values('10002',to_date('2002-10-12','yyyy-mm-dd'));
when i search this record.
1.in the sqlplus env,i can get the exact records.
2.in the jsp file . i use java.text.SimpleDateFormat to format the Date like this:
SimpleDateFormat sdfTmp=new SimpleDateFormat("yyyy-MM-dd");
String strTime=sdfTmp.format(rs.getDate("order_date"));
but the strTime is not exactly show as the in the
sqlplus env. why?
 
 
subject: why what i search is not what i want?