• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date Problem

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys... I get this error message... I'm not really feeling well right now so I hope you won't mind if I just paste the error and the code...



type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Value '0000-00-00' can not be represented as java.sql.Date
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.TimeKeepingSystem.timeadjust_jsp._jspService(org.apache.jsp.TimeKeepingSystem.timeadjust_jsp:240)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
com.mysql.jdbc.ResultSet.getNativeDate(ResultSet.java:3481)
com.mysql.jdbc.ResultSet.getNativeDate(ResultSet.java:3421)
com.mysql.jdbc.ResultSet.getNativeConvertToString(ResultSet.java:3369)
com.mysql.jdbc.ResultSet.getNativeString(ResultSet.java:4001)
com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5115)
com.mysql.jdbc.ResultSet.getString(ResultSet.java:4961)
blackmarlins.dao.DBHelper.getPPInfo(DBHelper.java:350)
org.apache.jsp.TimeKeepingSystem.timeadjust_jsp._jspService(org.apache.jsp.TimeKeepingSystem.timeadjust_jsp:56)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.






Ok... I think I'll do some explaining afterall... I get the error message whenever I call pPB.setDateOut(rs.getString(6)) where date_out's value from the database is 0000-00-00... I'm not even getting a null value... I'm totally clueless... Any help? Thanks!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the JDBC forum... Please continue the discussion over there.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Timothy,
What does it print if you try:


Different drivers handle getting dates in different ways.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic