Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column of BIT(1) type


Advanced Search

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column of BIT(1) type
Posted by: Tal Snir ()
Date: October 18, 2007 02:53AM

Hello Good People,

I am working in an environment of Linux Redhat 3, MySQL 5.0.27 and JDBC 3.1.12.
I have a Java Application using hibernate to communicate with the DB.
I am having this non-consistent problem, basically there are times that when I am trying to write to columns of bit datatype I get a nasty log, that ends with the following messages:

Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'modified' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1166)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1082)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1067)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462)
... 58 more

Have anyone ever seen that one before? What dos it mean?

Thanks a lot,

Tal.

Options: ReplyQuote


Subject Written By Posted
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column of BIT(1) type Tal Snir 10/18/2007 02:53AM
Re: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column of BIT(1) type Geert van der Ploeg 01/03/2008 04:13AM


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.