[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql-java
Subject: Re: Can't seem to fix: Value '0000-00-00' can not be represented
From: Mark Matthews <mark () mysql ! com>
Date: 2005-04-09 17:41:41
Message-ID: 425813D5.3070304 () mysql ! com
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bob_Savard@adovo.com wrote:
> Hi.
>
> I just upgraded to 4.1.11 and C/J 3.1.7. I've read the upgrade notes about
> setting the zeroDateTimeBehavior config property and I must be doing
> something stupid because it's not fixing the problem.
>
> Here's the line of code that the trace points to:
> Date expiration = rs.getDate("Expiration");
>
> I've also tried this form:
> Timestamp expiration = rs.getTimestamp("Expiration");
>
> The table's Expiration column is date; I've also tried datetime. The
> default value is set to 00-00-0000 or 00-00-0000 00:00:00 respectively, and
> all the column's values are set to the default when I get the error.
>
> Tomcat 5.5.7's web.xml's context has this defined:
>
> <Resource
> name="jdbc/test"
> auth="Container"
> type="javax.sql.DataSource"
>
> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
> username="tomcat"
> password="tomcat"
>
> driverClassName="com.mysql.jdbc.Driver"
>
> url="jdbc:mysql://localhost:3306/test?autoReconnect=true&noDatetimeStringSync=true"
> maxActive="10"
> maxIdle="30"
> minIdle="10"
> maxWait="20000"
> poolPreparedStatements="true"
> maxOpenPreparedStatements="0"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"
> defaultAutoCommit="true"
> defaultReadOnly="false"
>
> defaultTransactionIsolation="REPEATABLE_READ"
>
> zeroDateTimeBehavior="convertToNull"
> />
>
> What am I doing wrong??
>
> Thanks for any help/pointers!
>
>
Bob,
Looks like you need an & between each name/value pair in your
URL...Tomcat's not going to pass anything after
'noDatetimeStringSync=true" to the driver, and it won't warn you about
it either (it's kind of lax about its XML parsing :|)
-Mark
- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
MySQL User Conference (Santa Clara CA, 18-21 April 2005)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCWBPVtvXNTca6JD8RAjktAJ9amjQMk+w+8eiXquyqlJIm2E12HACfTg8X
AX2V6pnx02h2jYQ/BwSwIL0=
=W1Xw
-----END PGP SIGNATURE-----
--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=mysql-java@progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic