| Author |
illegalArgument exception
|
Patricia Samuel
Ranch Hand
Joined: Sep 12, 2007
Posts: 300
|
|
Hi all, Please suggest some solution for this query - a column in a table of TIMESTAMP datatype. i am fetching information through jdbc rs.getTimeStamp(columnName) but getting this exception message Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff at java.sql.Timestamp.valueOf(Timestamp.java:185) at oracle.jdbc.driver.OracleStatement.getTimestampValue(OracleStatement.java:4776) at oracle.jdbc.driver.OracleResultSetImpl.getTimestamp(OracleResultSetImpl.java:663) at oracle.jdbc.driver.OracleResultSet.getTimestamp(OracleResultSet.java:1625) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getTimestamp(NewProxyResultSet.java:3394) ... 34 more
|
 |
krishnamoorthy kitcha
Ranch Hand
Joined: Feb 04, 2006
Posts: 96
|
|
Dear Tweety Samuel In the default it returns the string type Do not use like this rs.getTimeStamp(columnName) just invoke this String date=rs.getString(Columnname); then type cast for date format like java.text.SimpleDateFormat df= new java.text.SimpleDateFormat("yyyy-mm-dd HH:ss"); java.text.SimpleDateFormat def= new java.text.SimpleDateFormat("dd/mm/yyyy"); date = df.parse(def.format(date)); Check and tell me your feedback.
|
 |
Patricia Samuel
Ranch Hand
Joined: Sep 12, 2007
Posts: 300
|
|
Thanks for the reply!!! I have found the solution of my problem. Actually, intended format was not set in the database. nls_format for session altered. now its working.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: illegalArgument exception
|
|
|