Resultset Java To Json. ResultSet rs stmtexecuteQuery sql. However we cant directly obtain JSON array if we are using Java querying data from database via JDBC.
ResultSet Interface is present in the javasql package. However we cant directly obtain JSON array if we are using Java querying data from database via JDBC. ResultSet rs stmtexecuteQuerysql.
The following is the code I have implemented to convert the ResultSet List to a JSON.
Staff staff gsonfromJson json Staffclass. This post shows how you can convert a javasqlResultSet to JSON and stream it back to the caller. However we cant directly obtain JSON array if we are using Java querying data from database via JDBC. ResultSet rs stmtexecuteQuery sql.