This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 193562 - java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
Summary: java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql....
Status: RESOLVED DUPLICATE of bug 159197
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-17 19:58 UTC by rperazzo
Modified: 2010-12-21 10:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 171909


Attachments
stacktrace (1.43 KB, text/plain)
2010-12-17 19:59 UTC, rperazzo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rperazzo 2010-12-17 19:58:58 UTC
Build: NetBeans IDE Dev (Build 201012150001)
VM: Java HotSpot(TM) Client VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Windows 7

User Comments:
rperazzo: why?

GUEST: not showing data because the format of a date attribute in the table

GUEST: class not found exception: java.lang.classnotfoundexception: com.mysql.jdbc.driver

GUEST: error reads no access




Stacktrace: 
java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)
   at com.mysql.jdbc.ResultSetRow.getDateFast(ResultSetRow.java:143)
   at com.mysql.jdbc.ByteArrayRow.getDateFast(ByteArrayRow.java:240)
Comment 1 rperazzo 2010-12-17 19:59:02 UTC
Created attachment 104231 [details]
stacktrace
Comment 2 Jiri Rechtacek 2010-12-21 10:27:01 UTC
Phrased from issue 159197:

------- Comment #1 From Jiri Rechtacek 2009-07-16 20:25:04 (-) [reply] -------

It's a known problem in MySQL, need to set a special parameter in MySQL driver
- http://bugs.mysql.com/bug.php?id=13261.
With this parameter is works better.

------- Comment #2 From Jiri Skrivanek 2009-09-14 14:41:50 (-) [reply] -------

Please, use zeroDateTimeBehavior=convertToNull while connecting to your
databse. E.g.:

jdbc:mysql://localhost:3306/test?zeroDateTimeBehavior=convertToNull

*** This bug has been marked as a duplicate of bug 159197 ***