Sunday, July 20, 2014

not null value convert into null value in sql query

// Start Consultent
    public List getConsultentAppoinData(String valSpecial_name) {

        List<ReasonAppPatientInfo> consultentAppPatientList = new ArrayList<ReasonAppPatientInfo>();
        boolean fg = true;
        con = dbc.connectDB();

        Statement st1 = null;
        ResultSet rs1 = null;
        if (con == null) {
            fg = false;
        }

        String addCon = "is null";
        if (valSpecial_name != null) {
            addCon = "=" + valSpecial_name;
        }


        if (fg) {
            try {

                st1 = con.createStatement();

                String query1 = "select doctor_no,doctor_name,doc_chember from hpms_doctor where specialization_no "
                        + addCon;


                System.out.println(query1);

                rs1 = st1.executeQuery(query1);

                while (rs1.next()) {

                    ReasonAppPatientInfo reasonAppPatientInfo = new ReasonAppPatientInfo();
                    reasonAppPatientInfo.setDOCTOR_NO(rs1.getString("doctor_no"));
                    reasonAppPatientInfo.setDOCTOR_NAME(rs1.getString("doctor_name"));
                    reasonAppPatientInfo.setDOC_CHEMBER(rs1.getString("doc_chember"));
                    consultentAppPatientList.add(reasonAppPatientInfo);
                }

            } catch (SQLException sq) {
                sq.printStackTrace();
            } finally {
                try {
                    if (rs1 != null) {
                        rs1.close();
                    }

                    con.close();
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }
            }
        }

        return consultentAppPatientList;
    }

    // End Consultent

Tuesday, July 1, 2014

Hierarchy Maintain ( Single cotation and Double cotation )


double cotation then single cotation .If also need cotation in single cotation then use double votation and single cotation .
Also it wil be reverse situation.

Exam 1 :
onclick="doEditData('recordId<%=k %>');"


Exam 2:
 String  qty = "select recognition_status,recognition_date,permitted_date,recognition_expire_date from institutes_recognition where institute_id='"+institute_id+"' and EDUCATION_LEVEL_ID='"+edulevlId+"'";