Re: SQLJSON

Поиск
Список
Период
Сортировка
От Steven Schlansker
Тема Re: SQLJSON
Дата
Msg-id F9AA993B-8CF6-4DFE-B582-BD775DCC1583@gmail.com
обсуждение исходный текст
Ответ на SQLJSON  (Dave Cramer <davecramer@gmail.com>)
Ответы Re: SQLJSON  (Dave Cramer <davecramer@gmail.com>)
Список pgsql-jdbc
On Jun 26, 2015, at 7:57 AM, Dave Cramer <davecramer@gmail.com> wrote:

> I'm looking for comments on how to implement a SQLJSON type in JDBC.
>
> As there is no getSQLJSON in the resultset interface this could only be used in getObject.
>
> Notionally it would model itself after SQLXML.
https://docs.oracle.com/javase/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
SQLXMLinterface adds any value to passing rs.getBinaryStream to your favorite JSON parser.  Especially since you would
haveto 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 will agree on which JSON parsing library to
use.

I'm sure I'm missing something?



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Markus KARG"
Дата:
Сообщение: Re: SQLJSON
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: SQLJSON