1,105,281 Community Members

How to retrive array from database

Member Avatar
Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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 spring and I created pojo(bean) class like

public class ExperimentParameterBean {
	
	private String username;
	private String[] exp_values;	
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String[] getExp_values() {
		return exp_values;
	}
	public void setExp_values(String[] arrayData) {
		this.exp_values = arrayData;
	}	

}

and also I used hibernate for retrieving values from database I want these array as it is
in java how can I do?

Member Avatar
ejosiah
Junior Poster
196 posts since Feb 2008
Reputation Points: 4 [?]
Q&As Helped to Solve: 23 [?]
Skill Endorsements: 3 [?]
 
0
 

store the array as a blob or clob using hibernate and hibernate should take care of retrieving it for you from the database

Member Avatar
Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

store the array as a blob or clob using hibernate and hibernate should take care of retrieving it for you from the database

thanks

Member Avatar
Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks

but my data is in json format then how can i store as a blob data in mysql

Question Answered as of 1 Year Ago by ejosiah
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: