如何反序列化json对象并将其保存到数据库中 [英] how to deserialize json object and save it into database
问题描述
我将获得格式的json对象
{
投诉:{
encounterdata :{
firstname:< first name =>,
lastname:< last name => ,
性别:,
地址:{
address1:< address1>,
address2:< address2>,
city:< city>,
州:< ;州>,
pincode:< pincode>
},
email:< email id =>,
phone:< phone number =>,
id:{
idtype:< idtype>,
idnumber :< idnumber>
}
},
diagnosticdata:{
ecg:{
ecgfilename:< complaintid_ecg.jpg>
},
bpm:{
sysrate:< systolic rate =>,
diarate:< dialect rate => ,
pulserate:< pulse rate =>
},
温度:{
温度: <体温>
},
spo2:{
oxypercentage:<氧气百分比= >
},
胎儿多普勒:{
心率:< heartbeat rate =>< br $>
}
}
}
现在我需要对这个json数据进行反序列化并将其保存在数据库中,我该怎么做呢。
查看链接b elow
i will get json object of format
{
"complaint": {
"encounterdata" : {
"firstname": "<first name="">",
"lastname" : "<last name="">",
"gender" : "",
"address" : {
"address1": "<address1>",
"address2": "<address2>",
"city" : "<city>",
"state" : "<state>",
"pincode" : "<pincode>"
},
"email" : "<email id="">",
"phone" : "<phone number="">",
"id" : {
"idtype" : "<idtype>",
"idnumber" : "<idnumber>"
}
},
"diagnosticdata" : {
"ecg" : {
"ecgfilename" : "<complaintid_ecg.jpg>"
},
"bpm" : {
"sysrate" : "<systolic rate="">",
"diarate" : "<dialect rate="">",
"pulserate" : "<pulse rate="">"
},
"temperature" : {
"temperature" : "<body temperature>"
},
"spo2" : {
"oxypercentage" : "<oxygen percentage="">"
},
"fetaldoppler" : {
"heartrate" : "<heartbeat rate="">"
}
}
}
}
Now i need to deserialize this json data and save it in database,how can i do that.
Look on the link below
这篇关于如何反序列化json对象并将其保存到数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!