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