use of com.zyf.bean.Info24 in project HeartWatchdogJsp by Viczyf.
the class Info24Dao method queryInfo24.
public List queryInfo24(int uid) {
String sql = "";
sql = "select * from info24 where uid='" + uid + "' order by id desc";
ArrayList list = null;
Info24 info24 = null;
ResultSet rs = this.connection.executeQuery(sql);
if (rs != null) {
list = new ArrayList();
try {
while (rs.next()) {
info24 = new Info24();
info24.setId(rs.getInt(1));
info24.setUid(rs.getInt(2));
info24.setDate(rs.getString(3));
info24.setTime(rs.getInt(4));
info24.setDataaddr(rs.getString(5));
info24.setConclusionaddr(rs.getString(6));
list.add(info24);
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return list;
}
use of com.zyf.bean.Info24 in project HeartWatchdogJsp by Viczyf.
the class Info24Dao method queryInfoSingle.
public Info24 queryInfoSingle(int id, int uid) {
Info24 info24 = null;
String sql = "select * from info24 where id=" + id + " and uid=" + uid;
ResultSet rs = this.connection.executeQuery(sql);
try {
if (rs.next()) {
info24 = new Info24();
info24.setId(rs.getInt(1));
info24.setUid(rs.getInt(2));
info24.setDate(rs.getString(3));
info24.setTime(rs.getInt(4));
info24.setDataaddr(rs.getString(5));
info24.setConclusionaddr(rs.getString(6));
}
} catch (SQLException e) {
e.printStackTrace();
}
return info24;
}
use of com.zyf.bean.Info24 in project HeartWatchdogJsp by Viczyf.
the class Info24Servlet method select_con_list.
public void select_con_list(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Info24Dao info24Dao = new Info24Dao();
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
int uid = user.getUid();
// List infoList = info24Dao.queryInfo24(uid);
// JsonArray array = new JsonArray();
int id = MyTools.strToint(request.getParameter("id"));
Info24 single = info24Dao.queryInfoSingle(id, uid);
JsonObject ob = new JsonObject();
String conclusion = "";
String addr = single.getConclusionaddr();
String file = request.getSession().getServletContext().getRealPath("/") + "24holter/conclusion/" + addr;
try {
BufferedReader rd = new BufferedReader(new FileReader(file));
String s = rd.readLine();
while (null != s) {
conclusion += s;
s = rd.readLine();
}
rd.close();
// System.out.println(str);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
conclusion = "[" + conclusion + "]";
ob.addProperty("con", conclusion);
// array.add(ob);
PrintWriter out = response.getWriter();
out.print(ob);
out.flush();
out.close();
}
use of com.zyf.bean.Info24 in project HeartWatchdogJsp by Viczyf.
the class Info24Dao method queryTimeInfo.
public List queryTimeInfo(int uid, String startdate, String enddate) {
String sql = "";
sql = "select * from info24 where uid='" + uid + "'" + "and to_days(date)>=to_days('" + startdate + "') and to_days(date)<=to_days('" + enddate + "') order by id desc";
ArrayList list = null;
Info24 info24 = null;
ResultSet rs = this.connection.executeQuery(sql);
if (rs != null) {
list = new ArrayList();
try {
while (rs.next()) {
info24 = new Info24();
info24.setId(rs.getInt(1));
info24.setUid(rs.getInt(2));
info24.setDate(rs.getString(3));
info24.setTime(rs.getInt(4));
info24.setDataaddr(rs.getString(5));
info24.setConclusionaddr(rs.getString(6));
list.add(info24);
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return list;
}
Aggregations