Re: Data truncation throws java.sql.SQLException instead of com.mysql.jdbc.MysqlDataTruncation
Posted by: Mark Matthews
Date: November 30, 2005 08:31PM

Jesus Marquez Sanchez wrote:
> Hi,
>
> I'm experiencing the following exception:
>
> java.sql.SQLException: Data truncated for column
> 'LockedMaterialQuantity' at row 1
>
>
> I had a look at MySQL pages about this truncation
> error and found the property
> "jdbcCompliantTruncation" to be set to FALSE to
> solve this problem.
>
> It doesn't work basically because the JDBC is not
> reporting a "com.mysql.jdbc.MysqlDataTruncation"
> exception. Instead, it is throwing a
> "java.sql.SQLException" one.
>
> The offending query is setting the column
> LockedMaterialQuantity to '', which is what this
> "jdbcCompliantTruncation" property is for. But the
> log file is not showing a
> "com.mysql.jdbc.MysqlDataTruncation" exception at
> all.
>
> I'm running MySQL Server 5.0.15.
> JDBC driver is "mysql-connector-java-3.1.11"
> OS: Microsoft Windows 2003 Server SP1
> I'm also running Tomcat 5.5.12
>
> Connection URL:
> jdbc:mysql://localhost:3306/MagazzinoAutomatico?jd
> bcCompliantTruncation=false
> Connection Driver: com.mysql.jdbc.Driver
>
> Any help appreciated.
>
> Regards,
> Jesus


Jesus,

Please paste a full stack trace of your exception. It will be easier for us to then tell what's going on.

Thanks!

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.