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?

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

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

thanks

thanks

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.