jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes Retrieving array from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Retrieving array from database" Watch "Retrieving array from database" New topic

Retrieving array from database

pravin rasal
Ranch Hand

Joined: Jul 27, 2011
Posts: 63
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

Joined: Mar 22, 2000
Posts: 13036
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?

Roberto Perillo

Joined: Dec 28, 2007
Posts: 2271

I think this has more to do with HTML and JavaScript. So, let's move this one to the HTML, CSS and JavaScript forum.

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
pravin rasal
Ranch Hand

Joined: Jul 27, 2011
Posts: 63
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

Joined: Jan 10, 2002
Posts: 63844

JSON is just a text string. You can store a JSON string in any text column that's big enough to hold it.

[Asking smart questions] [About Bear] [Books by Bear]
pravin rasal
Ranch Hand

Joined: Jul 27, 2011
Posts: 63
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' :""}
I agree. Here's the link: http://aspose.com/file-tools
subject: Retrieving array from database
jQuery in Action, 3rd edition