Subject Re: [Firebird-Java] DataTruncation in PreparedStatement.setString
Author Roman Rokytskyy
> DataTruncation error accures if PreparedStatement.setString(int,String)
> is called with a string value longer than the corresponding field in the
> database.
> It's may be okey by insert or update statements, but
> in my case I tried to execute a sql-statement like 'select ... from...
> where str_field like ?'
> It's a bug?

A bug, but not in driver. If you pass longer string in parameter, you will
crash the server. So far this bug is not fixed in Firebird, so it was
decided that it is better to throw DataTruncation.

> Is there any workarond to avoid this problem?

I do not know about any.