Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving array from database

 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have created one array in java script like this:
obj.push({'key' :value1, 'key2' :value2})
and it is stored in database ,but problem is that when I am retrieving again back from database I am confusing to how to get array from database because it is stored in following format :
[object Object],[object Object],[object Object] :-these are totallay 3 values.
how to get this array and how to separate key value pair in java
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly how did you store this JavaScript in the database?

I don't understand what you mean by

[object Object],[object Object],[object Object] :-


why not as just a single JSON string?

Bill
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this has more to do with HTML and JavaScript. So, let's move this one to the HTML, CSS and JavaScript forum.
 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i want to store JSON in database then how can I store JSON in database in the form of key value pair and also I want to retrieve JSONfrom database then how can I get this JSON
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64849
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSON is just a text string. You can store a JSON string in any text column that's big enough to hold it.
 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to store element at run time means I have two combo box and when I am changing value of both combo box the value will be stored in JSON if I am changing combo box
three times then total number of three values will be stored in JSON
my json is :
var data ={'concent' :"", 'conce2' :""}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic