Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using getDate for ResultSet in jsp

843838May 6 2006 — edited Aug 9 2006
Hello,

In a jsp I'm trying to display a date stored in a mysql database.
In the jsp i have put the following:
<TD align='right'>Meeting Date</TD>
<TD align='right'>
<INPUT type='text' name='meetingDate' value='<%= rsClients.getDate("meetingDate") %>'</TD>
</TR>

rsClients is the ResultSet where I have stored mysql table data.

But when I run servlet that subsequently fires up jsp to display data stored in mysql database I get the following sql exception:
java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
at com.mysql.jdbc.ResultSet.getDateFromString(ResultSet.java:1913)
at com.mysql.jdbc.ResultSet.getDate(ResultSet.java:1849)
at com.mysql.jdbc.ResultSet.getDate(ResultSet.java:1817)
at com.mysql.jdbc.ResultSet.getDate(ResultSet.java:1865)
at org.apache.jsp.ProcessClients$jsp._jspService(ProcessClients$jsp.java:154)

Can anyone explain why I'm getting this error please,

Cheers Joe.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2006
Added on May 6 2006
3 comments
1,430 views