java.lang.ClassCastException:org.postgresql.util.PGobject

时间:2012-04-21 21:52:52

标签: android postgresql-9.1

代码优先:

PGpoint coordinates = (PGpoint) rs.getObject(4);

导致ClassCastException。

在项目中引用postgresql-9.1-901.jdbc3.jar。

在Android应用程序上返回记录集。有什么方法可以绕过这个吗?

TIA

1 个答案:

答案 0 :(得分:0)

这与问题org.postgresql.util.PGobject cannot be cast to org.postgis.PGgeometry非常相似。下面引用的答案提到postgis.jar没有安装属性。这可能也适用于你的情况吗?如何 你安装postgis?

  

如果在提供JDBC的Web容器中使用Hibernate Spatial   通过容器通过JNDI,postgis.jar也应该是   与JDBC驱动程序一起安装,不应包含在内   WEB-INF / lib目录