Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3F8169FB35C for ; Mon, 5 Mar 2007 12:16:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 23615-01-2 for ; Mon, 5 Mar 2007 12:15:43 -0400 (AST) X-Greylist: delayed 00:31:10.35692 by SQLgrey-1.7.4 Received: from mail37.bayern.de (mail37.bayern.de [62.134.61.37]) by postgresql.org (Postfix) with ESMTP id 3096A9FB3E2 for ; Mon, 5 Mar 2007 12:15:42 -0400 (AST) Received: from mail22.bayern.de ([10.2.10.22]) by mail37.bayern.de (8.13.8/8.13.8) with ESMTP id l25FiUkp015204 for ; Mon, 5 Mar 2007 16:44:30 +0100 Received: from mailse.bvv.bayern.de (ns2.bvv.bayern.de [10.192.101.2]) by mail22.bayern.de (8.13.8/8.13.8) with ESMTP id l25FiRt6006142 for ; Mon, 5 Mar 2007 16:44:27 +0100 Received: from va45s01.va-lvg.bvv.bayern.de (va45s01.va-lvg.bvv.bayern.de [10.192.100.1]) by mailse.bvv.bayern.de (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id l25FiRb2013004 for ; Mon, 5 Mar 2007 16:44:27 +0100 Received: from va45c72.va-lvg.bvv.bayern.de (va45c72.va-lvg.bvv.bayern.de [10.192.100.81]) by va45s01.va-lvg.bvv.bayern.de (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id l25FiR4E026820 for ; Mon, 5 Mar 2007 16:44:27 +0100 From: Danny Schueler To: pgsql-jdbc@postgresql.org Subject: jdbc integer value oid to big! Date: Mon, 5 Mar 2007 16:44:26 +0100 User-Agent: KMail/1.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200703051644.26759.danny.schueler@bvv.bayern.de> X-Scanned-By: MIMEDefang 2.51 on 10.192.101.2 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.316 tagged_above=0 required=5 tests=BAYES_50, SARE_MILLIONSOF X-Spam-Level: X-Archive-Number: 200703/30 X-Sequence-Number: 16744 I try to use WFS-Tools like deegree or geoserver. Both are based on the jdbc-psql driver, to connect to a postgis-database. org.postgresql.util.PSQLException: Bad value for type int int : 3364667332. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2R= esultSet.java:2630) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2= ResultSet.java:1968) at org.postgresql.jdbc2.TypeInfoCache.getPGType(TypeInfoCache.java:= 161) at org.postgresql.jdbc2.AbstractJdbc2Connection.getPGType(AbstractJ= dbc2Connection.java:974) at org.postgresql.jdbc2.AbstractJdbc2Statement.setPGobject(Abstract= Jdbc2Statement.java:1539) at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJd= bc2Statement.java:1678) at org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJd= bc3Statement.java:1438) at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJd= bc2Statement.java:1689) at org.deegree.io.datastore.sql.AbstractSQLDatastore.prepareStateme= nt(Unknown Source) at org.deegree.io.datastore.sql.QueryHandler.performContentQuery(Un= known Source) at org.deegree.io.datastore.sql.QueryHandler.performQuery(Unknown S= ource) at org.deegree.io.datastore.sql.AbstractSQLDatastore.performQuery(U= nknown Source) at org.deegree.io.datastore.sql.AbstractSQLDatastore.performQuery(U= nknown Source) at org.deegree.io.datastore.schema.MappedFeatureType.performQuery(U= nknown Source) at org.deegree.ogcwebservices.wfs.GetFeatureHandler$Performer.run(U= nknown Source) jdbc tries to connect to my huge database, where millions of geographic dat= asets are stored. In the next step, the software tries to detect the java-type of the values.= For this issue, it is necessary, the determine the databases-oid of the dataset or the oid of the row. both are above 2,1 billion (above 2^31) in my postgres-db! It seems, that the jdbc-function "AbstractJdbc2ResultSet.toInt" can't handl= e those values and throws this error, when it tries to parse the string to integer (the Type for this value was r= eturned from the TypeInfoCache) for Example : Class.forName("org.postgresql.Driver"); String url =3D "jdbc:postgresql://foo:/bar"; AbstractJdbc2Connection conn =3D (AbstractJdbc2Connection)DriverManager.get= Connection(url, "postgres" , ""); TypeInfoCache tic =3D new TypeInfoCache(conn); Statement st =3D conn.createStatement(AbstractJdbc2ResultSet.TYPE_FORWARD_O= NLY,AbstractJdbc2ResultSet.CONCUR_READ_ONLY); AbstractJdbc2ResultSet rs=3D(AbstractJdbc2ResultSet)st.executeQuery("select= oid,obnr,poly from table limit 1;"); while (rs.next()) { if (tic.getJavaClass(rs.getColumnOID(1)).equals("java.lang.Integer")) { int value =3D rs.getInt(1); } } in short: The software detects the db-oids, determies the type of the value= s with the TypeInfoCache and gets Integer. The following attemt, to get the variable i= n it's original type, fails and results in an error! The database can handle integer values with max. values until 2^32 as oid (= unsigned), the jdbc can handle only 2^31 (signed). What can i do, to fix this Problem? =2D-=20 Mit freundlichen Gr=FC=DFen Danny Sch=FCler =20 Sachgebiet 423 Bereitstellung von Fachdaten Landesamt f=FCr Vermessung und Geoinformation Alexandrastra=DFe 4, 80538 M=FCnchen Tel: =A0089 2129-2958 =46ax: 089 2129-22958 Mail: danny.schueler@bvv.bayern.de