• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Date Problem

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the JDBC forum... Please continue the discussion over there.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Timothy,
What does it print if you try:


Different drivers handle getting dates in different ways.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic