Search in sources :

Example 6 with Medicalhistory

use of com.zyf.bean.Medicalhistory in project HeartWatchdogJsp by Viczyf.

the class MedicalhistoryDao method queryList.

public List queryList(int uid) {
    String sql = "select * from medicalhistory where uid='" + uid + "' order by id desc";
    ArrayList list = new ArrayList();
    Medicalhistory mhis = null;
    ResultSet rs = this.connection.executeQuery(sql);
    if (rs != null) {
        try {
            while (rs.next()) {
                mhis = new Medicalhistory();
                mhis.setId(rs.getInt("id"));
                mhis.setUid(rs.getInt("uid"));
                mhis.setCity(rs.getString("city"));
                mhis.setDate(rs.getString("date"));
                mhis.setHospital(rs.getString("hospital"));
                mhis.setOffice(rs.getString("office"));
                mhis.setDoctor(rs.getString("doctor"));
                mhis.setConclusion(rs.getString("conclusion"));
                list.add(mhis);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
    return list;
}
Also used : SQLException(java.sql.SQLException) ArrayList(java.util.ArrayList) ResultSet(java.sql.ResultSet) Medicalhistory(com.zyf.bean.Medicalhistory)

Aggregations

Medicalhistory (com.zyf.bean.Medicalhistory)6 User (com.zyf.bean.User)4 MedicalhistoryDao (com.zyf.dao.MedicalhistoryDao)4 HttpSession (javax.servlet.http.HttpSession)4 PrintWriter (java.io.PrintWriter)3 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 RequestDispatcher (javax.servlet.RequestDispatcher)1