Package com.mysql.jdbc

Examples of com.mysql.jdbc.ResultSet


            htmlPage += "</div>"//div header end
           
            //Stampa risultato ricerca
            if(request.getParameter("date")!=null){
                dbManager db = new dbManager();
                ResultSet r = db.getPreviousVaccinationsPatients(new Integer(seconds));
                db.releaseConnection();
                htmlPage += "<div class=\"content\">";
                htmlPage+="<form action=\"Conferma\" method=\"POST\">\n";
                htmlPage+="<p class=\"submit\"><input type=\"submit\" name=\"Conferma\" value=\"Conferma\" /></p>\n";
               
                //Prima riga della tabella
                htmlPage+="<TABLE>\n";
                htmlPage+="<tr>\n";
                htmlPage+="<th></th>\n";
                htmlPage+="<th>Nome</th>\n";
                htmlPage+="<th>Cognome</th>\n";
                htmlPage+="<th>M/F</th>\n";
                htmlPage+="<th>Data di vaccinazione</th>\n";
                htmlPage+="<th>Medico</th>\n";
                htmlPage+="<th>Seleziona</th>\n";
                htmlPage+="</tr>\n";
               
                try {
                   
                    if(r.first()){
                        while (!r.isAfterLast()) {
                           
                            Paziente p = new Paziente(r);
                           
                            if (!arrayPazienti.add(p))
                                Log4k.warn(Richiamo.class.getName(), "il paziente non e` stato inserito nel'array");
                           
                            htmlPage+="<TR>\n";
                            htmlPage+="<TD><img src=\"photo/"+p.getPicture()+"\" height=\"50\" width=\"50\" alt=\"Foto Paziente\" /></TD>\n";
                            htmlPage+="<TD>"+p.getName()+"</TD>\n";
                            htmlPage+="<TD>"+p.getSurname()+"</TD\n>";
                            htmlPage+="<TD>"+p.getGender()+"</TD>\n";
                            htmlPage+="<TD>"+p.getVaccination_date()+"</TD>\n";
                            htmlPage+="<TD>"+p.getDoctor_id()+"</TD>\n";
                            htmlPage+="<TD><input type=\"checkbox\" name=\""+checkboxname+"\" value=\""+p.getId()+"\" /></TD>\n";
                            htmlPage+="</TR>\n";
                            r.next();
                        }
                    }
                } catch (SQLException ex) {
                    htmlPage+="</div></div></BODY></HTML>\n";
                    Log4k.error(Richiamo.class.getName(), ex.getMessage());
View Full Code Here


            htmlPage += "</div>"//div header end
           
            //Stampa risultato ricerca
            if(request.getParameter("date")!=null){
                dbManager db = new dbManager();
                ResultSet r = db.getFollowingVaccinationsPatients(new Integer(seconds));
                db.releaseConnection();
                htmlPage += "<div class=\"content\">";
               
                //Prima riga della tabella
                htmlPage+="<TABLE>\n";
                htmlPage+="<tr>\n";
                htmlPage+="<th></th>\n";
                htmlPage+="<th>Nome e Cognome</th>\n";
                htmlPage+="<th>M/F</th>\n";
                htmlPage+="<th>Data di vaccinazione</th>\n";
                htmlPage+="<th>Medico</th>\n";
                htmlPage+="</tr>\n";
               
                try {
                   
                    if(r.first()){
                        while (!r.isAfterLast()) {
                            Paziente p = new Paziente(r);
                           
                            htmlPage+="<TR>\n";
                            htmlPage+="<TD>"+"<img src=\"photo/"+p.getPicture()+"\" height=\"50\" width=\"50\" alt=\"Foto Paziente\" /></TD>\n";
                            htmlPage+="<TD><a href=\"Profilo?id="+p.getId()+"\">"+p.getName()+" "+p.getSurname()+"</a></TD>\n";
                            htmlPage+="<TD>"+p.getGender()+"</TD>\n";
                            htmlPage+="<TD>"+p.getVaccination_date()+"</TD>\n";
                            htmlPage+="<TD>"+p.getDoctor_id()+"</TD>\n";
                            htmlPage+="</TR>\n";
                            r.next();
                        }
                    }
                } catch (SQLException ex) {
                    htmlPage+="</div></div></BODY></HTML>\n";
                    Log4k.error(Richiamo.class.getName(), ex.getMessage());
View Full Code Here

                    ex.getMessage() + "\n\tcommand was " + command);
        }
    }
   
    ResultSet executeQuery(String query){
        ResultSet res = null;
        try {
            Statement statement = (Statement) conn.createStatement();
            res = (ResultSet) statement.executeQuery(query);
            /* we must not close the statement here, otherwise res drops */
        } catch (SQLException ex) {
View Full Code Here

                    htmlPage+="</TR>";
                   
                   
                    User paziente = loggedUser;
                    dbManager db = new dbManager();
                    ResultSet res = db.getPatientVaccinations(paziente.getId());
                    db.releaseConnection();
                    try{
                        if(res.first()){
                            while(!res.isAfterLast()){
                                int medId = res.getInt("doctor_id");
                                String date = res.getString("vaccination_date");
                               
                                dbManager dbMed = new dbManager();
                                ResultSet doctor = dbMed.getDoctor(medId);
                                dbMed.releaseConnection();
                               
                                String doctorName="";
                                if(doctor.first()){
                                    while(!doctor.isAfterLast()){
                                        doctorName = doctor.getString("name")+" "+doctor.getString("surname");
                                        doctor.next();
                                    }
                                }
                               
                                htmlPage+="<TR>\n";
                                htmlPage+="<TD>"+doctorName+"</TD>\n";
View Full Code Here

            String usr = request.getParameter("user");
            String psw = request.getParameter("password");
            boolean isDoc = request.getParameter("type").equals("medico");
           
            dbManager dbM = new dbManager();
            ResultSet res = dbM.userMatches(usr, psw, isDoc);
            dbM.releaseConnection();
           
            if (res.first()){
                HttpSession session = request.getSession();
                User loggedUser = (User) session.getAttribute("loggedUser");
                if (loggedUser == null){
                    loggedUser = new User(res, isDoc);
                    session.setAttribute("loggedUser", loggedUser);
View Full Code Here

                    + "</HEAD><BODY>";
                String htmlOutro = "</BODY></HTML>";
           
            if(request.getParameter("id")!=null){
                dbManager db = new dbManager();
                ResultSet r1 = db.getPatient(new Integer(request.getParameter("id")));
                ResultSet r2 = db.getPatientVaccinations(new Integer(request.getParameter("id")));
                db.releaseConnection();
               
                try {
                  
                htmlPage+=htmlIntro;
                htmlPage += "<div class=\"container\">";
                htmlPage += "<div class=\"header\">";
                                
                    if(r1!=null && r2!=null){
                        if(r1.first()){
                            User p = new User(r1, false);
                            htmlPage += "<img id=\"welcomeImage\" src=\"" + Macro.BASE + "photo/"+p.getPicture()+"\" />";
                            htmlPage += "<p class=\"headerInfo\">Paziente: "+p.getName()+" "+p.getSurname()+"</p>";
                            htmlPage += "<p class=\"headerInfo\">Data di nascita: "+p.getBirthdate()+"<br />";
                            htmlPage += "Sesso: "+p.getGender()+"</p>";
                            htmlPage += "<p class=\"headerInfo\"><a href=\"" + Macro.BASE + "\" title=\"Home\">Torna alla Home</a></p>\n";
                        }
                       
                    htmlPage += "</div>"//div header end
                    htmlPage += "<div class=\"content\">";
                    htmlPage+="<TABLE>\n";
                                htmlPage+="<TR>\n";
                                htmlPage+="<th>Data di Vaccinazione</th>\n";
                                htmlPage+="<th>Dr.</th>\n";
                                htmlPage+="<th></th>\n";
                                htmlPage+="<th>ID</th>\n";
                                htmlPage+="</TR>\n";
                               
                        if(r2.first()){
                            while (!r2.isAfterLast()) {
                                htmlPage+="<TR>\n";
                                htmlPage+="<TD>"+r2.getString("vaccination_date")+"</TD>\n";
                                htmlPage+="<TD>"+r2.getString("surname")+"</TD>\n";
                                htmlPage+="<TD>"+r2.getString("name")+"</TD>\n";
                                htmlPage+="<TD>"+r2.getString("doctor_id")+"</TD>\n";
                                htmlPage+="</TR>\n";
                                r2.next();
                            }
                            } else {
                                htmlPage+="<TR>\n";
                                htmlPage+="<TD> Mai Vaccinato </TD>\n";
                                htmlPage+="<TD> - </TD>\n";
View Full Code Here

    public List getPipeLineListByObjectInspectionId(Integer id, Properties props) throws SQLException {

        Connection dbConn = getConnection(props);
        Statement st = (Statement) dbConn.createStatement();
        ResultSet rs = (ResultSet) st.executeQuery("select * from pipeLineElement where objectId=" + id);
        List plList = setValues(rs);
        rs.close();
        return plList;


    }
View Full Code Here

    public List getPipeLineListByObjectInspectionAndDetailType(Integer typeId, Integer objectId, Properties props) throws SQLException {


        Connection dbConn = getConnection(props);
        Statement st = (Statement) dbConn.createStatement();
        ResultSet rs = (ResultSet) st.executeQuery("select * from pipeLineElement where objectId=" + objectId + " and detailTypeId=" + typeId);
        List plList = setValues(rs);
        rs.close();

        return plList;
    }
View Full Code Here

    public List getConstructionDefectZonesByConstrType(String typeId,  String buildingObjectId,Properties props) throws SQLException {


        Connection dbConn = getConnection(props);
        Statement st = (Statement) dbConn.createStatement();
        ResultSet rs = (ResultSet) st.executeQuery("select constructionDefectsZone.constructionDefectId from constructionExamples, constructionDefectsZone where constructionExamples.buildObjectId="+buildingObjectId+" and constructionExamples.exampleId=constructionDefectsZone.exampleId and constructionDefectsZone.constructionTypeId="+typeId+" group by uniqueForExamples");
        List plList = setValues(rs);
        rs.close();

        return plList;
    }
View Full Code Here

    }

    public List getExamplesByDefect(String unique,Properties properties) throws SQLException {
        Connection dbConn = getConnection(properties);
        Statement st = (Statement) dbConn.createStatement();
        ResultSet rs = (ResultSet) st.executeQuery("select exampleId from constructionDefectsZone where uniqueForExamples="+unique);
        List list=new ArrayList();
        while (rs.next()) {
              list.add(rs.getString(1));
        }
        rs.close();
        return list;
    }
View Full Code Here

TOP

Related Classes of com.mysql.jdbc.ResultSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.