• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrive array from database

 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have stored an array in database field name "exp_values" like :

[{"concentration":"30","answers":60},{"concentration":"30","answers":60},{"concentration":"30","answers":60}]

and I want to retrieve from database I am using jsp servlet and I created pojo(bean) class like




and also I used hibernate for retrieving values from database I want these array as it is
in java how can I do?
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok can we break this question down...

do you know how to do the hibernate end, how to get the data from the database using hibernate, and get the data back from there into POJOs?


This will be a lot quicker if you tell us what your exact problem is, it is going to take a very long time if you wait for me to ask a whole list of yes or no questions, and to be honest I may get bored halfway.
 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know the hibernate my problem is that how can I retrieve that array and stored in JSONObject
 
Winston Gutkowski
Bartender
Pie
Posts: 10090
55
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pravin rasal wrote:I have stored an array in database field name "exp_values" like :
[{"concentration":"30","answers":60},{"concentration":"30","answers":60},{"concentration":"30","answers":60}]

Sounds like that may be your problem right there. Seems very contrived to me (and totally de-normalized). Why not just set up a database table for it?

Winston
 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My thread is solved .I done this by using text datatype in mysql....thanks to all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic