com.mysql.jdbc.MysqlDataTruncation



Hi
I am trying to insert my file content to the Mysql 5.0, i am trying
to insert 1000 files, but when inserting some of the file, i got an
exception, why?

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for
column 'content' at row 1
at
com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:709)
at
com.mysql.jdbc.MysqlIO.scanForAndThrowDataTruncation(MysqlIO.java:3461)
at
com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1198)
at
com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:677)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1357)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1274)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1259)

The file that cause the exception is arround 85KB. and here is the
table structure:

CREATE TABLE `articles` (
`id` int(11) NOT NULL auto_increment,
`major` text NOT NULL,
`minor` text NOT NULL,
`author` text NOT NULL,
`url` text NOT NULL,
`topic` text NOT NULL,
`content` text NOT NULL,
`filename` text NOT NULL,
`filesize` int(11) NOT NULL default '0',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`rank` int(11) NOT NULL default '0',\n PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=gb2312


thanks
from Peter (cmk128@xxxxxxxxxxx)

.



Relevant Pages

  • com.mysql.jdbc.MysqlDataTruncation
    ... insert 1000 files, but when inserting some of the file, i got an ... com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for ... The file that cause the exception is arround 85KB. ... `filesize` intNOT NULL default '0', ...
    (comp.lang.java.programmer)
  • Re: primary key vs unique key
    ... Westcoast Sheri wrote: ... Duplicates allowed - this is why it is called UNIQUE. ... From MySQL 4.1, the key attribute ... This exception does not apply to BDB tables, ...
    (comp.lang.php)
  • JasperException - little details.
    ... I've recently developed a JSP page for retrieving data from a mysql ... I have created java classes to generate the graph that I want, ... by getting the data from the mysql database but the only difference is ... I get this horrible exception that makes no ...
    (comp.lang.java.programmer)
  • Re: com.mysql.jdbc.MysqlDataTruncation
    ... com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for ... The file that cause the exception is arround 85KB. ... "If you assign a value to a BLOB or TEXT column that exceeds the data ...
    (comp.lang.java.databases)
  • Re: Qualifizierte Attributnamen?
    ... MySQL liefert in den Metadaten des Resultsets alle notwendigen Daten ... Collation: binary ... 'TIMESTAMP' definiert. ... Eine Exception ist ein Fehler.Auch ...
    (de.comp.datenbanken.mysql)