Reputation: 41
I have datatype called "json" in postgres db. I wanted to insert data gson object from java code.
How can i insert gson object data into json column of table in postgres database?
Can any one help me?
Thanks,
Upvotes: 1
Views: 1969
Reputation: 1169
In Postgres SQL the json type is similar to text type and in java the corresponding mapping will be String type.The important thing is that json String must be valid json because there is a validation at database end.
Refer this link for clarification
Upvotes: 4