On 03/07/2016 07:15 PM, Curt Huffman wrote:
Thanks Rob & David!
I got it to work using the following:
String qry = "INSERT INTO event "
+ "(spotid, qid, userid, persid, , "
+ "evtvalue, evtdt, evtjson) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?,to_json(?::json));";
and
pStmt.setString
Thanks Rob & David!
I got it to work using the following:
String qry = "INSERT INTO event "
+ "(spotid, qid, userid, persid, , "
+ "evtvalue, evtdt, evtjson) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?,to_json(?::json));";
and
pStmt.setString (11,dtlRec.toString());
(another suggestion was to use:
On Mon, Mar 7, 2016 at 8:15 PM, Curt Huffman wrote:
> Thanks Rob & David!
>
> I got it to work using the following:
>
>
> String qry = "INSERT INTO event "
> + "(spotid, qid, userid, persid, , "
> + "evtvalue, evtdt, evtjson) "
> +
On Mon, 2016-03-07 at 09:32 -0700, David G. Johnston wrote:
>
> >
> > Hint: You will need to rewrite or cast the expression.
> >
> Take the hint, literally. You never did show the SQL but usually the
> least complex way to solve this is to indeed transfer the data as a
> string/text and then
On 03/07/2016 05:25 AM, Curt Huffman wrote:
Hello!
I’m struggling to insert a JSON object into my postgres v9.4 DB. I have
defined the column called "evtjson" as type json. (not jsonb)
I am trying to use a prepared statement in Java (jdk1.8) to insert a
Json object (built using JEE javax.json
> pStmt.setString(11, dtlRec.toString());
> pStmt.setObject(11, dtlRec.toString());
>
> Which produce a different error:
>
> Event JSON: {"New MbrID":29}
>
> SQLException: ERROR: column "evtjson" is of type json but expression is of
> type character varying
>
> Hint: You will need to rewrite or
Hello!
I’m struggling to insert a JSON object into my postgres v9.4 DB. I have
defined the column called "evtjson" as type json. (not jsonb)
I am trying to use a prepared statement in Java (jdk1.8) to insert a Json
object (built using JEE javax.json libraries) into the column, but I keep
running