Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 070649FB79A for ; Fri, 3 Aug 2007 03:54:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 74110-05 for ; Fri, 3 Aug 2007 03:54:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from conscius.com (helloworld.conscius.com [62.243.211.122]) by postgresql.org (Postfix) with ESMTP id 9A3709FB6FE for ; Fri, 3 Aug 2007 03:54:32 -0300 (ADT) Received: by conscius.com (CommuniGate Pro PIPE 4.2.10) with PIPE id 1430446; Fri, 03 Aug 2007 08:55:46 +0200 Received: from [192.168.1.5] (account dth HELO [192.168.5.251]) by conscius.com (CommuniGate Pro SMTP 4.2.10) with ESMTP id 1430445; Fri, 03 Aug 2007 08:55:44 +0200 Message-ID: <46B2D126.6070309@conscius.com> X-ProcessedID: 46B2D126.6070309@conscius.com Date: Fri, 03 Aug 2007 08:54:30 +0200 From: =?ISO-8859-1?Q?Dennis_Thrys=F8e?= User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-jdbc@postgresql.org Subject: Re: LargeObject API References: <46B18B42.2020709@conscius.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200708/13 X-Sequence-Number: 17326 Kris Jurka wrote: > On Thu, 2 Aug 2007, Dennis Thrysøe wrote: > >> Is there any way to use the proprietary LargeObject API, without >> actually having a reference to the postgresql Drivers's Connection >> object? > > Often connection wrappers provide a means to access the underlying > Connection. You don't say what you're using so you'll have to consult > those docs yourself. My goal is to support any j2ee server, so I cannot assume much about any proxy/pooling mechanism. > stmt.execute("CREATE TABLE t (a int, b oid)"); > stmt.execute("INSERT INTO t VALUES (1, lo_creat(-1))"); > ResultSet rs = stmt.executeQuery("SELECT b FROM t WHERE a = 1"); > rs.next(); > Blob b = rs.getBlob(1); Thanks. That looks like a good solution. -dennis --------------------------------------------------------------------------- The information in this email is confidential and may be legally protected.