Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8X0m-0004MF-9L for pgsql-jdbc@arkaria.postgresql.org; Fri, 26 Jun 2015 17:01:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z8X0l-0007CT-8b for pgsql-jdbc@arkaria.postgresql.org; Fri, 26 Jun 2015 17:01:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z8X0k-0007CI-3Y for pgsql-jdbc@postgresql.org; Fri, 26 Jun 2015 17:01:54 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z8X0h-0002Td-6r for pgsql-jdbc@postgresql.org; Fri, 26 Jun 2015 17:01:52 +0000 Received: by pabvl15 with SMTP id vl15so71734654pab.1 for ; Fri, 26 Jun 2015 10:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yJtg39MxQjYYefE/0EfpOBP6VZ2SviI6HGXnUPR9No0=; b=p6zH8zEfherhJg/DrEu3hdft6aKp2wZyzMTJ0Kc/s+Uhho9HE6EPKZmrpzNTnbE68m XLWIrhCMV/sWnYAJhjSxSEuiVUEFG9o0ytrTmzeyV3sQIRxEg0rBzvG40SQ/0JJmSlqD dhv3bKVgVDav68oScGE5oKZB8iPW+PZzTjDrVa5zyGYyA84FtKPiqjXNOTYvyN+1oaVw xeXhQrz9AZ5A5sDcK0VQBQWbczZf2dyqSBAhzNfPT5eBSYwYKnyda1qZO/Z7fT6nOOK6 Mksj/8Gj7q9ev58byYAVAWhh9I5qt4klUBHZPUW2Y0BWYuB8xt1pthOGUsXf71LFpZ9Q jpJw== X-Received: by 10.70.96.36 with SMTP id dp4mr5257138pdb.65.1435338110095; Fri, 26 Jun 2015 10:01:50 -0700 (PDT) Received: from [10.10.21.68] (otra.opentable.com. [199.16.144.7]) by mx.google.com with ESMTPSA id do3sm33874813pbb.5.2015.06.26.10.01.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jun 2015 10:01:49 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: SQLJSON From: Steven Schlansker In-Reply-To: Date: Fri, 26 Jun 2015 10:01:47 -0700 Cc: List Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Dave Cramer X-Mailer: Apple Mail (2.1878.6) X-Pg-Spam-Score: -1.2 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Jun 26, 2015, at 7:57 AM, Dave Cramer wrote: > I'm looking for comments on how to implement a SQLJSON type in JDBC. >=20 > As there is no getSQLJSON in the resultset interface this could only be u= sed in getObject. >=20 > Notionally it would model itself after SQLXML. https://docs.oracle.com/ja= vase/7/docs/api/index.html?java/sql/SQLXML.html I used JSON extensively in one of my projects, but have never used SQLXML. = I'm having trouble understanding why the SQLXML interface adds any value t= o passing rs.getBinaryStream to your favorite JSON parser. Especially sinc= e you would have to use getObject, I am not seeing how: rs.getObject("field", SQLJSON.class).mapToType(MyType.class) is simpler than: jacksonObjectMapper.readValue(rs.getBinaryStream("field"), MyType.class) which already works today as far as I understand. Doubly so since nobody w= ill agree on which JSON parsing library to use. I'm sure I'm missing something? --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc