We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to retrive array from database

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?

2
Contributors
3
Replies
6 Days
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0

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

ejosiah
Junior Poster
196 posts since Feb 2008
Reputation Points: 72
Solved Threads: 23
Skill Endorsements: 3

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

thanks

Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0

thanks

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

Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 6 Months Ago by ejosiah

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0754 seconds using 2.7MB