如何使用json的数据格式给Highcharts赋值
1个回答
展开全部
package cn.sdeit.beans;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import cn.sdeit.mysql.ConnectMySql;
public class User
{
private String email;
private String password;
private String rePassword;
private String tel;
private String name;
private String sex;
private String birthday;
private String university;
private String major;
private String sID;
private int year;
public User(String email, String password, String rePassword,
String tel, String name, String sex, String birthday,
String university, String major, String sID, int year)
{
super();
this.email = email;
this.password = password;
this.rePassword = rePassword;
this.tel = tel;
this.name = name;
this.sex = sex;
this.birthday = birthday;
this.university = university;
this.major = major;
this.sID = sID;
this.year = year;
}
public User(String email)
{
super();
/*
* 此构造方法目的获取 UserBean 对象
* */
this.email = email;
}
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getRePassword()
{
return rePassword;
}
public void setRePassword(String rePassword)
{
this.rePassword = rePassword;
}
public String getTel()
{
return tel;
}
public void setTel(String tel)
{
this.tel = tel;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getSex()
{
return sex;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getBirthday()
{
return birthday;
}
public void setBirthday(String birthday)
{
this.birthday = birthday;
}
public String getUniversity()
{
return university;
}
public void setUniversity(String university)
{
this.university = university;
}
public String getMajor()
{
return major;
}
public void setMajor(String major)
{
this.major = major;
}
public String getsID()
{
return sID;
}
public void setsID(String sID)
{
this.sID = sID;
}
public int getYear()
{
return year;
}
public void setYear(int year)
{
this.year = year;
}
public String getUserString()
{
return "邮箱:" + email + "</br>"
+ "密码:"+password+ "</br>"
+ "号码:" + tel + "</br>"
+ "姓名:"+ name + "</br>"
+ "性别:" + sex + "</br>"
+ "生日:" + birthday+ "</br>"
+ "学校:" + university + "</br>"
+ "专业:" + major + "</br>"
+ "学号:"+ sID + "</br>"
+ "入学年份:" + year;
}
public User getOnlineUserBean()
{
Connection connection = ConnectMySql.createConnection();
String sql = "select * from user where email = ?";
PreparedStatement prepared = ConnectMySql.createPreparedStatement(connection, sql);
User onlineUserBean = null;
try
{
prepared.setString(1, email);
ResultSet set = prepared.executeQuery();
while(set.next())
{
onlineUserBean = new User(set.getString("email"), set.getString("password"),
set.getString("password"), set.getString("tel"), set.getString("name"),
set.getString("sex"), set.getString("birthday"), set.getString("university"),
set.getString("major"), set.getString("sid"), set.getInt("year"));
}
connection.close();
} catch (SQLException e)
{
e.printStackTrace();
}
return onlineUserBean;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询