Spring Version: 3.9.15.RELEASE OpenJDK8
I want to convert Java Object that is derived from Oracle DB into JSON array.
I need to put JSON array's data into a data table which allows only JSON array type as an input.
I have been trying to use jackson-databind but I'm still struggling.
I won't need any parameter to call the data because the page I'm working doesn't take any further input to refresh or update the data table.
[ {
"ID" : "sample1",
"nickname" : "올드희",
"name": "김영희",
"phone": "010-1234-5678",
"email": "[email protected]"
},
{
"ID" : "sample2",
"nickname" : "짱구친구",
"name": "김철수",
"phone": "010-5555-1111",
"email": "[email protected]"
} ]
Above is the desirable Jsonarray form I want to get.
Below is the select query of mapper file.
<select id="selectNormalList" parameterType="string" resultType="Member">
SELECT
M.ID
, NICKNAME
, NAME
, PHONE
FROM
MEMBER M
LEFT JOIN
M_NORMAL N ON(M.ID = N.ID)
WHERE
GRADE = 'N'
</select>
If I have to use jackson-databind because there is no alternative,
Q1) Is Ajax necessary to call the data?
Q2) Is @PathVariable necessary?
If not, I'll be very appreciate with your advice.