Package realcix20.utils

Examples of realcix20.utils.DAO


        }
       
        public static String getLD(Row correspondenceRow) {
           
                String ld = null;
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_LD_FROM_PA_SQL);
                dao.setObject(1, ObjectUtil.findNewCell(correspondenceRow, "T", "NS").getColumnValue().toString());
                dao.setObject(2, ObjectUtil.findNewCell(correspondenceRow, "T", "P").getColumnValue().toString());
                dao.setObject(3, ObjectUtil.findNewCell(correspondenceRow, "T", "PA").getColumnValue().toString());
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next()) {
                        ld = rs.getString("LD");
                    }
                    rs.close();
View Full Code Here


                Cell paCell = ObjectUtil.findNewCell(mainRow, "T", "PA");
                String pa = (String)paCell.getColumnValue();
               
                String urns = null;
                String urp = null;
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_URNS_URP_FORM_P_SQL);
                dao.setObject(1, ns);
                dao.setObject(2, p);
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next()) {
                        urns = rs.getString("URNS");
                        urp = rs.getString("URP");
                    }
                    rs.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
               
                String urpa = null;
                dao.query(Resources.SELECT_URPA_FROM_PA_SQL);
                dao.setObject(1, ns);
                dao.setObject(2, p);
                dao.setObject(3, pa);
                rs = dao.executeQuery();
                try {
                    if (rs.next()) {
                        urpa = rs.getString("URPA");
                    }
                    rs.close();
View Full Code Here

       
        private boolean isthisPartnerAccountCanTransfer(String ns, String p, String pa) {
           
                boolean result = false;
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_URPA_FROM_PA_SQL);
                dao.setObject(1, ns);
                dao.setObject(2, p);
                dao.setObject(3, pa);               
                ResultSet rs = dao.executeQuery();
                try {                   
                    if (rs.next()) {                       
                        String urpa = rs.getString("urpa");                      
                        if ( (urpa == null) || (urpa.trim().equals("")) )
                            result = false;
View Full Code Here

       
        private PrivateKey getPriKey(String ns, String p, String pa) {
           
                PrivateKey priKey = null;
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_PRIKEY_FROM_PA_BY_NS_P_PA_SQL);
                dao.setObject(1, ns);
                dao.setObject(2, p);
                dao.setObject(3, pa);
                dao.setObject(4, ns);
                dao.setObject(5, p);
                dao.setObject(6, pa);
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next())
                        priKey = (PrivateKey)rs.getObject("PRIKEY");
                    rs.close();
                } catch (Exception e) {
View Full Code Here

    public static void deleteDependThings(Row anaTypeRow) {       
        String at = ObjectUtil.findNewCell(anaTypeRow, "AT", "AT").getColumnValue().toString();
        AnaProfileClass anaProfile = (AnaProfileClass)ClassManager.createClass(130);       
        StringBuffer sb = new StringBuffer("DELETE FROM " + anaProfile.getChildTableName() + " WHERE AT=?");
        String sql = sb.toString();
        DAO dao = DAO.getInstance();     
        dao.update(sql);
        dao.setObject(1, at);
        dao.executeUpdate();  
        sb = new StringBuffer("DELETE FROM " + anaProfile.getMainTableName() + "" +
                " WHERE APF NOT IN (SELECT APF FROM " + anaProfile.getChildTableName() + ")");
        sql = sb.toString();
//        System.out.println(sql);
        dao.update(sql);
        dao.executeUpdate();
    }
View Full Code Here

        if (e.getActionCommand().equals("Cancel")) {
          container.setEnabled(true);
            dispose();
        } else if (e.getActionCommand().endsWith("Confirm")) {
            if (!nameField.getText().trim().equals("")) {
                DAO dao = DAO.getInstance();
                String txtId = "CL." + object.getClsId() + "." + layout;
                Item item = (Item)languageChooser.getSelectedItem();
                String lang = item.getFactValue().toString();
                String long_c = nameField.getText();

                dao.query(Resources.SELECT_TXT_TABLE_SQL);
                dao.setString(1, txtId);
                dao.setString(2, lang);
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next()) {
                        dao.update(Resources.UPDATE_TXT_SQL);
                        dao.setString(1, long_c);
                        dao.setString(2, txtId);
                        dao.setString(3, lang);
                        dao.executeUpdate();
                    } else {
                        dao.update(Resources.INSERT_TXT_SQL);                           
                        dao.setString(1, txtId);
                        dao.setString(2, lang);
                        dao.setString(3, long_c);
                        dao.executeUpdate();
                    }
                    rs.close();
                } catch (Exception ee) {
                }
                container.setEnabled(true);
View Full Code Here

//              make selectedRow 1 as templateRow
                if(i==0){
                  newRow = ObjectUtil.cloneRow(getContainer().getCurrentObject(),row);                 
                    //set child row need added & set new primary key to childRows
                    //get new PrimaryKey R.R , RI.R                   
                    DAO dao = DAO.getInstance();
                    dao.query(Resources.SELECT_MAX_R_FROM_R_SQL);
                    ResultSet rs = dao.executeQuery();
                    try {
                        if (rs.next())
                            newR = rs.getInt(1) + 1;
                        rs.close();
                    } catch (Exception e) {
View Full Code Here

            container.getCurrentObject().loadChilds(selectedRow);           
            Row newRow = ObjectUtil.cloneRow(container.getCurrentObject(), selectedRow);
            //set child row need added & set new primary key to childRows
            //get new PrimaryKey R.R , RI.R
            int newR = 0;
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_MAX_R_FROM_R_SQL);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next())
                    newR = rs.getInt(1) + 1;
                rs.close();
            } catch (Exception e) {
View Full Code Here

                DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
                if (node.getUserObject() instanceof ObjectInfo) {
                    ObjectInfo oj = (ObjectInfo)node.getUserObject();
                    if (oj.flag.equals("layout")) {

                        DAO dao = DAO.getInstance();
                        dao.query(Resources.SELECT_CL_SQL);
                        dao.setInt(1, getContainer().getCurrentObject().getClsId());
                        dao.setInt(2, oj.layout);
                        ResultSet rs = dao.executeQuery();
                        try {

                            if (rs.next()) {
                                if (rs.getBoolean("ISFAVORITE") == !favorite) {

                                    dao.update(Resources.UPDATE_CL_ISFAVORITE_SQL);
                                    dao.setBoolean(1, favorite);
                                    dao.setInt(2, getContainer().getCurrentObject().getClsId());
                                    dao.setInt(3, oj.layout);
                                    dao.executeUpdate();
                                    getContainer().updateTree();
                                   
                                }
                            }
View Full Code Here

    }
   
    private void exitApplication() {      
            int n = DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("alert.exit"));          
            if (n == 0) {//exit application
                DAO dao = DAO.getInstance();
                dao.commit();
                dao.deleteDAO();
                System.exit(0);               
            }
       
    }       
View Full Code Here

TOP

Related Classes of realcix20.utils.DAO

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.