Hi,

You are right, it is a bug. Originally ResultSetMetaData returned
java.sql.Blob. But at that time, ResultSet.getObject returned an
InputStream... Then I fixed that, and ResultSetMetaData returned
java.util.InputStream. But then the behavior of ResultSet.getObject
changed (version 1.1.104 I believe), and I forgot to change back
ResultSetMetaData.

This will be fixed in the next release.

Regards,
Thomas


On Mon, May 25, 2009 at 5:03 AM, [email protected]
<[email protected]> wrote:
>
> Hi,
>
> I wrote similar one on 2008-07-26 here. The subject is
> 'ResultSetMetaData.getColumnClassName is working correctly?'.
>
> Returned value of ResultSetMetaData.getColumnClassName isn't match the
> result of ResultSet.getObject. Following is a sample code.
>
>
> Connection conn = DriverManager.getConnection("jdbc:h2:mem:test",
> "sa", "");
> Statement stat = conn.createStatement();
> stat.executeUpdate("CREATE TABLE t (blob BLOB, clob CLOB)");
> stat.executeUpdate("INSERT INTO t VALUES (1234,'asdf')");
> ResultSet rs = stat.executeQuery("SELECT blob,clob FROM t");
> ResultSetMetaData rsmd = rs.getMetaData();
> System.out.println(rsmd.getColumnClassName(1));
> System.out.println(rsmd.getColumnClassName(2));
> rs.next();
> System.out.println(rs.getObject(1).getClass().getName());
> System.out.println(rs.getObject(2).getClass().getName());
> rs.close();
> stat.close();
> conn.close();
>
> == The result ==
> java.io.InputStream
> java.io.Reader
> org.h2.jdbc.JdbcBlob
> org.h2.jdbc.JdbcClob
>
> == I expect. ==
> java.sql.Blob
> java.sql.Clob
> org.h2.jdbc.JdbcBlob
> org.h2.jdbc.JdbcClob
>
>
> Thanks.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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