Hello,
I am getting the MysqlDataTruncation exception, and i do not know why.
I have tried to enter data automaticly from my java program, but from time to
time I get this error.
do you have an idea?
thanks
Marcelo
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column
'url' at row 1
at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:709)
at com.mysql.jdbc.MysqlIO.scanForAndThrowDataTruncation(MysqlIO.java:3408)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1802)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.Statement.execute(Statement.java:529)
at tools.SQLTools.runSQL(SQLTools.java:34)
at tools.SQLTools.insertURL(SQLTools.java:44)
at extraction.DumpImages.fillSQLTables(DumpImages.java:86)
at extraction.DumpImages.dumpFromURL(DumpImages.java:76)
at extraction.DumpImages.run(DumpImages.java:39)
Rhino - 19 Dec 2005 04:50 GMT
> Hello,
>
[quoted text clipped - 24 lines]
> at extraction.DumpImages.dumpFromURL(DumpImages.java:76)
> at extraction.DumpImages.run(DumpImages.java:39)
It's very hard to diagnose a problem within code with only the error
message; we could be more helpful if you included the code that you executed
to get this message. A definition of the table would also be very helpful.
I've never had this particular error in MySQL so I can only make one guess,
but it may be completely wrong. _Perhaps_ you are trying to put too much
data into the column. For example, if your 'url' column is defined as
CHAR(50) and you are doing an Insert that contains a URL which is more than
50 characters, I would expect an error like this. But I don't know if you
are even doing an Insert; you haven't given us your code. An Update might
experience the same problem if you tried to change an existing URL to one
that was longer than the column allows. Even a Select can experience
truncation in some cases.
I'm not going to speculate any further without more information.
Rhino
Aj-India - 19 Dec 2005 10:39 GMT
Its because the column url in your table that has a fixed length and
the data you are inputting is exceeding that length. Try to change the
data type of the column to text or allocate more space for this column.
Roedy Green - 21 Dec 2005 01:29 GMT
>time I get this error.
>
>do you have an idea?
looks like the problem is here.
at extraction.DumpImages.fillSQLTables(DumpImages.java:86)
how about you show us some code.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.