Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 474262E012B for ; Fri, 1 Feb 2008 16:43:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85484-09 for ; Fri, 1 Feb 2008 16:42:55 -0400 (AST) Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id C74E82E0125 for ; Fri, 1 Feb 2008 16:42:54 -0400 (AST) Received: (qmail 27932 invoked by uid 1112); 1 Feb 2008 20:42:53 -0000 Date: Fri, 1 Feb 2008 15:42:53 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Brent Friedman cc: pgsql-jdbc@postgresql.org Subject: Re: Any examples for Postgresql 8.0 using jdbc type 2/3 driver with blobs? In-Reply-To: <94fa210b0801311324u2eb9013eq5ba8b54cd8a153f3@mail.gmail.com> Message-ID: References: <94fa210b0801311324u2eb9013eq5ba8b54cd8a153f3@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/3 X-Sequence-Number: 18210 On Thu, 31 Jan 2008, Brent Friedman wrote: > I made several attempts today to get an example of a blob insert via jdbc > working today, but ran into several errors. I tried both oid and bytea data > types, and tried the LargeObject manager/methods. [The bytea type probably > won't ultimately work for me - we need to be able to insert blobs of a few > megs each.] We use 8.0 in production, so newer examples with 8.1/8.2/8.3 > specific implementations wouldn't help very much. > > So, any ideas where I can find working examples of jdbc/blob operations? > http://jdbc.postgresql.org/documentation/83/binary-data.html The sample code here using the LargeObjectManager API should work. Checking the test suite is also a reasonable place to look for examples. See readWrite here: http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/jdbc/pgjdbc/org/postgresql/test/jdbc3/Jdbc3BlobTest.java?rev=1.6&content-type=text/x-cvsweb-markup Kris Jurka