I am trying to get json response from Postgresql database(v9.5) table to display on my view page, I have tried the following, as my application is executing fine, but I am not g
As indicated in the documentation, Anorm comes with column parsers for the JDBC standart types.
PostgreSQL JSON type is not one of those. It's a vendor specific type.
You can deal with this specific conversion in the statement, by casting the SQL column to TEXT
before to go through the JDBC (as plain JDBC String so).
SELECT json_col::TEXT FROM test
You can implement a custom Column[JsValue]
(see documentation), that convert the PGObject
specific to the PostgreSQL JDBC driver into a Play JsValue
.
You can map the column as anorm.Object
(SqlParser.get[anorm.Object]("col")
), and deal with the opaque value in your application.