From: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
To: Craig Ringer <ringerc@ringerc.id.au>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: json type
Date: Mon, 21 May 2012 19:57:05 +0300
Message-ID: <4FBA73E1.5090106@nitorcreations.com> (raw)
In-Reply-To: <4FB9FA49.4070409@ringerc.id.au>
References: <4FAB8796.40904@nitorcreations.com>
<4FB9FA49.4070409@ringerc.id.au>
On 05/21/2012 11:18 AM, Craig Ringer wrote:
> On 05/10/2012 05:17 PM, Mikko Tiihonen wrote:
>> Hi,
>>
>> Here is a patch to enable initial support for hstore in the jdbc driver.
>>
>> With the patch using ResultSet.getObject() on a hstore column and it returns a HashMap<String, String>
>> Similarly a Statement.setObject(Map<Object,Object> will send the data to backend using hstore format.
>
> That's absolutely brilliant, thankyou!
>
> Of course, now there's a `json' type that folks will probably use much of the time instead, not least because it should be easier to work with from JDBC. I
> doubt it'll be as efficient and fast as hstore for single-level key/value info though.
Unfortunately there is no standard json type on java side so adding support for json to postgres jdbc is not straight forward.
I've been thinking that we could have a code that allows the postgres jdbc user to set the json class to use (gson, org.json, json-simple, jackson) and add some
reflection code into the jdbc driver to return path so that it works nicely. And of course the reverse reflection code for sending json to database.
-Mikko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: mikko.tiihonen@nitorcreations.com, ringerc@ringerc.id.au
Subject: Re: json type
In-Reply-To: <4FBA73E1.5090106@nitorcreations.com>
References: <4FAB8796.40904@nitorcreations.com> <4FB9FA49.4070409@ringerc.id.au> <4FBA73E1.5090106@nitorcreations.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox