Re: Binary Cursors (& Geometric Type Support) - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Binary Cursors (& Geometric Type Support)
Date
Msg-id 3D8DE8A1.60307@xythos.com
Whole thread Raw
In response to Binary Cursors (& Geometric Type Support)  (Jeff Hoffmann <jeff@propertykey.com>)
List pgsql-jdbc
Jeff,

Since the curror is returning binary data, the only method that works re
retrieve the data is getBytes().  Get Object will not work with binary
cursors.

--Barry

Jeff Hoffmann wrote:
> I'm trying to port some code from C/libpq to Java & one of the things
> I'm having trouble with is getting binary cursors to work.  The C code
> uses a binary cursor to speed up a loop through a bunch of polygons & I
> was hoping it would have the same effect with Java.  The code for a
> non-binary cursor works fine, but is just taking too long.  Basically,
> here's what I'm doing:
>
> query.executeUpdate("declare my_cursor cursor for select p from
> my_polygon");
> ResultSet rs = query.executeQuery("fetch 1 from my_cursor");
> PGpolygon p = (PGpolygon)rs.getObject("p");
>
> When I switch the "cursor" to a "binary cursor", I get the following error:
>
> Conversion of point failed - java.lang.NumberFormatException:
> ??n?gk@A?z?v A?OT&?A@A
>
> Is there something else I have to do to get this to work or am I going
> to be out of luck?  I've seen references to people successfully using
> binaries cursors in earlier messages in the list -- is it just the
> non-standard geometric types that are troublesome from a binary
> perspective?
>
> Thanks,
>
> Jeff Hoffmann
> PropertyKey.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>


pgsql-jdbc by date:

Previous
From: Jeff Hoffmann
Date:
Subject: Binary Cursors (& Geometric Type Support)
Next
From: Jeff Hoffmann
Date:
Subject: Re: Binary Cursors (& Geometric Type Support)