We work with UUIDs. Every time when I call statement.setObject(parameterIndex, java.util.UUID.randumUUID().toString()); it throws an SQL exception. The column is generated with VarChar(100). Though there should be no Error. I solved it like this:
I modified in method setObject of org hsqldb.jdbc at line 1055:
public synchronized void setObject(int parameterIndex, Object x) throws SQLException
{
....if(UUID.randomUUID().getClass().equals(x.getClass()))
........x = x.toString();
....setParameter(parameterIndex, x);
}
It would be nice if Objects would be converted (when possible) to the Type of table. This may could be manged by an boolean.
It does not look like a correct report. If you call:
you are calling the equivalent of this:
The type of value is String, not UUID. Perhaps you are actually calling with a UUID object:
In this case an exception is thrown as you may be using an Object that does not have a proper toString() method.
Sorry I have copied my first fix in the first line. java.util.UUID.randomUUID throws this exception although it has a toString-method. So I could fixed it with the toString method. I'm very sorry about that mistake.
HSQLDB cannot figure out if an Object has a proper toString() method that represents it fully (for example the java.sql.Date type) or the toString() method of the Object is used. It therefore plays it safe and rejects the call.