Re: [GENERAL] Inserting JSON via Java PreparedStatment

2016-03-08 Thread Curt Huffman
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: cas

[GENERAL] Inserting JSON via Java PreparedStatment

2016-03-07 Thread Curt Huffman
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 i