sql - How to insert json data into my table using postgres -
i have clients table 2 columns
create table clients ( client_id serial primary key, name varchar(40) not null ) i have json info like
[{client_id:"1",name:"rick"},{client_id:"2",name:"carlin"}] now need utilize json parse , insert client table. how can using jsp servlets , postgres database.
if want on postgresql (9.3+) side, can utilize json_populate_recordset function:
insert clients select * json_populate_recordset( null::clients, '[{client_id:"1",name:"rick"},{client_id:"2",name:"carlin"}]' ) although, that's not idea manually insert values serial column.
sql json postgresql jsp servlets
No comments:
Post a Comment