MysqlDataTruncation: Data truncation: Data too long for column

0

i'm trying to configure a jaspersoft report at jasperserver with several text input controls. When I try with short values the report displays successfully.

 

But when i pass a long string input value, the server returns an error filling the report:

 

com.jaspersoft.jasperserver.api.JSException: Error filling report

 

Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'canales' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3607) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2293) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:239) ... 15 more

 

 

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'canales' at row 1
 
Traza de error
 
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'canales' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3607) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
anyulled's picture
Joined: Jul 12 2010 - 9:19am
Last seen: 6 years 11 months ago

1 Answer:

0

That has nothing to do with Jasper it is a MySQL Server error when it tries to run the query with the value you provided, have you tried running the query using the same input (long values) on MySQL directly? 

It may be also a known issue in MySQL with some special character (maybe acentos en español?) see this MySQL bug report http://bugs.mysql.com/bug.php?id=18908 and also this thread http://forums.mysql.com/read.php?103,51906,51906#msg-51906

marianol's picture
4778
Joined: Sep 13 2011 - 8:04am
Last seen: 1 year 1 month ago

I tried running the query with mysql workbench and it works perfectly. I don't use any accent, just calling an stored procedure with an input string with comma-separated values series of numbers.

Thanks for your help

anyulled - 6 years 11 months ago
Feedback
randomness