We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I try to map an Oracle CLOB column to a String. Sql2o called toString on the Clob-object and gets a string ala "com.oracle.Clob@6756767".
I worked around the problem like this:
private static class ClobConverter extends StringConverter { @Override public String convert(Object o) { if ( o instanceof Clob) { Clob clob = (Clob)o; try { return clob.getSubString(1, (int)clob.length()); } catch (SQLException e) { throw new RuntimeException("Error reading clob-value", e); } } else { return super.convert(o); } } }
and
Convert.registerConverter(String.class, new ClobConverter());
The text was updated successfully, but these errors were encountered:
fixes issue #12 - adds support for Clob values in string converter.
c37c0a3
No branches or pull requests
I try to map an Oracle CLOB column to a String.
Sql2o called toString on the Clob-object and gets a string ala "com.oracle.Clob@6756767".
I worked around the problem like this:
and
The text was updated successfully, but these errors were encountered: