Hi,

    PreparedStatement s = conn.prepareStatement("select cast(? as other)");
    s.setObject(1, "10");

This sets the value as a String, the same as:

    PreparedStatement s = conn.prepareStatement("select cast('10' as other)"
);

What you probably want is:

    PreparedStatement s = conn.prepareStatement("select cast(? as other)");
    s.setObject(1, "10", Types.OTHER);

or simpler:

    PreparedStatement s = conn.prepareStatement("select ?");
    s.setObject(1, "10", Types.OTHER);

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to