"create type" custom types not supported by JDBC
От | Roy Smith |
---|---|
Тема | "create type" custom types not supported by JDBC |
Дата | |
Msg-id | 475112C4.9060403@primetext.com обсуждение исходный текст |
Ответы |
Re: "create type" custom types not supported by JDBC
|
Список | pgsql-jdbc |
I'm getting errors when I'm trying to access my custom data types through JDBC. If I don't supply a custom map using Connection.setTypeMap() then I'm getting ... org.postgresql.util.PGobject cannot be cast to Money at ... Money m = (Money) resultSet.getObject(1); // Money is my class to handle multi-currency money types If I add a mapping with ... map.put("couk_cleverthinking_gwappo_currency",Class.forName("Money") ) connection.setTypeMap(map) Then I get ... java.lang.ClassCastException: java.lang.Class cannot be cast to java.sql.SQLData at org.postgresql.jdbc2.AbstractJdbc2Connection.getObject(AbstractJdbc2Connection.java:403) Poking around the source code of AbstractJdbc2Connection it looks like this functionality isn't support. Please could somebody confirm this is the cause and offer any insights as to when it might be included. Perhaps an "Unsupported feature" error would be more helpful than a ClassCastException. Very best wishes Roy
В списке pgsql-jdbc по дате отправления: