Package realcix20.utils

Examples of realcix20.utils.DAO


    boolean result = false;

    Cell newCell = ObjectUtil.findNewCell(selectedRow, "TAX", "TAXT");
    String taxt = (String) newCell.getColumnValue();
    DAO dao = DAO.getInstance();
    dao.query(Resources.SELECT_FROM_TAXT_SQL);
    dao.setString(1, taxt);
    ResultSet rs = dao.executeQuery();
    try {
      if (rs.next()) {
        String formula = rs.getString("FORMULA");
        result = (formula.indexOf("[B2]") != -1);
      }
View Full Code Here


                super();
                isPAndFButtonClicked = false;
                createShortcutKeySets();
                initComponents();
                tracks = new Vector();
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_FROM_ZN_BY_CLSID_SQL);
                dao.setInt(1, clsId);
                String n1 = null;
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next()) {
                        n1 = rs.getString("N");
                    }
                    rs.close();
View Full Code Here

       
        private Vector getAllChilds(Node parent) {
           
                Vector childs = new Vector();
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.GET_ALL_CHILDS_SQL);
                String n1 = parent.n;
                dao.setString(1, n1);
                ResultSet rs = dao.executeQuery();
                try {
                    while (rs.next()) {
                        String n2 = rs.getString("N2");
                        Node child = new Node(n2);
                        childs.add(child);
View Full Code Here

                public int clsId;
               
                public Node(String n) {
                   
                        this.n = n;
                        DAO dao = DAO.getInstance();
                        dao.query(Resources.SELECT_FROM_ZNL_BY_N_SQL);
                        dao.setString(1, n);
                        dao.setString(2, Resources.LANGUAGE);
                        ResultSet rs = dao.executeQuery();
                        try {
                            if (rs.next()) {
                                txt = rs.getString("TXT");
                                hlink = rs.getString("HLINK");     
                                clsId =rs.getInt("CLSID");
View Full Code Here

                        Vector rowData = new Vector();
                        Column column = (Column)columnIter.next();
                        rowData.add(column);
                        model.addRow(rowData);
                    }
                    DAO dao = DAO.getInstance();
                    dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_FOR_DISPLAY);
                    dao.setInt(1, object.getClsId());
                    dao.setInt(2, layout);
                    ResultSet rs = dao.executeQuery();
                    try {
                       
                        while (rs.next()) {
                            String tableName = rs.getString("TABLENAME");
                            String columnName = rs.getString("COLUMNNAME");
                            int disordinal = rs.getInt("DISORDINAL");
                            for (int i = 0 ; i <= model.getRowCount(); i++) {
                                Column column = (Column)model.getValueAt(i, 0);
                                if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) && (disordinal > 0) ) {
                                    model.removeRow(i);
                                    break;
                                }
                            }
                        }
                       
                        rs.close();
                    } catch (Exception e) {
                       
                    }
                   
                    model = (DefaultTableModel)getColumnDisplayTable().getModel();
                    dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_FOR_DISPLAY);
                    dao.setInt(1, object.getClsId());
                    dao.setInt(2, layout);
                    rs = dao.executeQuery();
                    try {
                       
                        while (rs.next()) {
                            String tableName = rs.getString("TABLENAME");
                            String columnName = rs.getString("COLUMNNAME");
                            int disordinal = rs.getInt("DISORDINAL");
                            columnIter = object.getColumns().iterator();
                            while (columnIter.hasNext()) {
                                Column column = (Column)columnIter.next();
                                if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) && (disordinal > 0) ) {
                                    Vector rowData = new Vector();
                                    rowData.add(column);
                                    if (column.isCountble())
                                        rowData.add(rs.getBoolean("ISCOUNT"));
                                    else
                                        rowData.add(null);
                                    if (column.isSumble())
                                        rowData.add(rs.getBoolean("ISSUMMARY"));
                                    else
                                        rowData.add(null);
                                    model.addRow(rowData);
                                    break;
                                }                                           
                            }                             
                        }
                       
                        rs.close();
                    } catch (Exception e) {
                       
                    }
                   
                    model = (DefaultTableModel)getColumnOrderSourceTable().getModel();
                    dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_ORDERBY_ORDERBYORDINAL);
                    dao.setInt(1, object.getClsId());
                    dao.setInt(2, layout);
                    rs = dao.executeQuery();
                    try {
                       
                        while (rs.next()) {
                            String tableName = rs.getString("TABLENAME");
                            String columnName = rs.getString("COLUMNNAME");
                            columnIter = object.getColumns().iterator();
                            while (columnIter.hasNext()) {
                                Column column = (Column)columnIter.next();
                                if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) ) {
                                    Vector rowData = new Vector();
                                    rowData.add(column);
                                    model.addRow(rowData);
                                    break;
                                }                                           
                            }                             
                        }
                       
                        rs.close();
                    } catch (Exception e) {
                       
                    }
                   
                model = (DefaultTableModel)getColumnOrderTable().getModel();
                dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_ORDERBY_ORDERBYORDINAL_FOR_ORDERBY);
                dao.setInt(1, object.getClsId());
                dao.setInt(2, layout);
                rs = dao.executeQuery();
                try {
                       
                    while (rs.next()) {
                        String tableName = rs.getString("TABLENAME");
                        String columnName = rs.getString("COLUMNNAME");
                        columnIter = object.getColumns().iterator();
                        while (columnIter.hasNext()) {
                            Column column = (Column)columnIter.next();
                            if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) ) {
                                Vector rowData = new Vector();
                                rowData.add(column);
                                if (rs.getObject("ORDERBYASCDES") == null)
                                    rowData.add(new Boolean(false));
                                else
                                    rowData.add(rs.getBoolean("ORDERBYASCDES"));
                                model.addRow(rowData);
                                break;
                            }                                           
                        }                             
                    }

                    rs.close();
                } catch (Exception e) {

                }
               
                model = (DefaultTableModel)getColumnAllTable().getModel();
                columnIter = object.getColumns().iterator();
                while (columnIter.hasNext()) {
                    Column column = (Column)columnIter.next();
                    Vector rowData = new Vector();                   

                    dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_AND_TABLENAME_AND_COLUMNNAME);
                    dao.setInt(1, object.getClsId());
                    dao.setInt(2, layout);
                    dao.setString(3, column.getTableName());
                    dao.setString(4, column.getColumnName());
                    rs = dao.executeQuery();
                    try {

                        if (rs.next()) {                           
                            if (rs.getBoolean("ANDOR") == true)
                                rowData.add("AND");
                            else
                                rowData.add("OR");
                            rowData.add(column);
                            if (rs.getString("FILTERCLAUSE") == null)
                                rowData.add("");
                            else
                                rowData.add(rs.getString("FILTERCLAUSE"));
                        } else {                           
                            rowData.add("AND");
                            rowData.add(column);
                            rowData.add("");
                        }                       
                        model.addRow(rowData);

                        rs.close();

                    } catch (SQLException e) {

                    }
                }
          //add CSQL
          dao.query(Resources.SELECT_CL_SQL);
          dao.setInt(1, object.getClsId());
          dao.setInt(2, layout);
          rs=dao.executeQuery();
          try {
            if(rs.next()){
              csqlPanel.setText(rs.getString("CSQL"));
            }
            rs.close();
View Full Code Here

       
        private int getNewLayout() {
           
                int layout = -1;
           
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_MAX_LAYOUT_SQL);
                dao.setInt(1, object.getClsId());
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next())
                        layout = rs.getInt(1) + 1;
                } catch (Exception e) {
                   
View Full Code Here

                DefaultMutableTreeNode favoritesNode = new DefaultMutableTreeNode(new ObjectInfo(-1,
                    TxtManager.getTxt("VIEW.MAINFRAME.TREE.DAILYREPORT"), "dailyReport"));
                bookNode.add(favoritesNode);
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_ALL_CLS_SQL);
                ResultSet rs = dao.executeQuery();
                try {

                    while (rs.next()) {
                        int clsId = rs.getInt("CLSID");
                        boolean isMyBook = rs.getBoolean("ISMYBOOK");
                        String str = new String("CLS." + clsId);
                        DefaultMutableTreeNode objectNode = new DefaultMutableTreeNode(new ObjectInfo(clsId,
                                TxtManager.getTxt(str), "object"));
                        //test
                        if (isMyBook)
                            bookNode.add(objectNode);
                        dao.query(Resources.SELECT_CLS_ALL_LAYOUTS_SQL);
                        dao.setObject(1, clsId);
                        ResultSet rs1 = dao.executeQuery();
                        try {                           
                            while (rs1.next()) {
                                str = new String("CL." + clsId + "." + rs1.getInt("LAYOUT"));
                                DefaultMutableTreeNode layoutNode = new DefaultMutableTreeNode(new ObjectInfo(clsId, rs1.getInt("LAYOUT"), TxtManager.getTxt(str), "report", rs1.getBoolean("ISFAVORITE")));
                                //fixȥ�����������ڵ�ı����ӽڵ�
//                                objectNode.add(layoutNode);
                                if (rs1.getBoolean("ISFAVORITE") == true)
                                    favoritesNode.add((DefaultMutableTreeNode)layoutNode.clone());
                            }
                            rs1.close();

                        } catch (SQLException e) {

                        }
                    }
                    rs.close();

                } catch (SQLException e) {

                }
                               
                DefaultMutableTreeNode bookSettingsNode = new DefaultMutableTreeNode(new ObjectInfo(-1,
                    TxtManager.getTxt("VIEW.MAINFRAME.TREE.ACCOUNTSETTINGNODE"), "accountSettings"));
               
                dao = DAO.getInstance();
                dao.query(Resources.SELECT_ALL_MOD_SQL);
                rs = dao.executeQuery();
                try {                  
                   
                    while (rs.next()) {
                        String mod = rs.getString("MOD");
                        DefaultMutableTreeNode moduleNode = new DefaultMutableTreeNode(new ObjectInfo(-1,
                                TxtManager.getTxt("MOD.".concat(mod)), "module"));
                        dao.query(Resources.SELECT_MOD_PROPERTIES_SQL);
                        dao.setString(1, mod);
                        ResultSet rs1 = dao.executeQuery();
                        boolean isMyBookSettings = false;
                        while (rs1.next()) {
                            isMyBookSettings = true;
                            int clsId = rs1.getInt("CLSID");
                            String str = new String("CLS." + clsId);
                            DefaultMutableTreeNode objectNode = new DefaultMutableTreeNode(new ObjectInfo(clsId,
                                    TxtManager.getTxt(str), "object"));
                            //test
                           
                            dao.query(Resources.SELECT_CLS_ALL_LAYOUTS_SQL);
                            dao.setObject(1, clsId);
                            ResultSet rs2 = dao.executeQuery();
                            try {
                                while (rs2.next()) {
                                    str = new String("CL." + clsId + "." + rs2.getInt("LAYOUT"));
                                    DefaultMutableTreeNode layoutNode = new DefaultMutableTreeNode(new ObjectInfo(clsId, rs2.getInt("LAYOUT"),
                                            TxtManager.getTxt(str), "report", rs2.getBoolean("ISFAVORITE")));
View Full Code Here

        }
       
        public void updateReportViewTable(int layoutId) {
            currentObject = ClassManager.createClass(currentObject.getClsId());
            setCurrentObject(currentObject);
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_CL_SQL);
            dao.setInt(1, currentObject.getClsId());
            dao.setInt(2, layoutId);
            ResultSet rs = dao.executeQuery();
            String report_basic_sql = null;
            //fix CSQL
            String csql = null;
            try {
                if (rs.next()){
View Full Code Here

   
    private boolean isRegCleared(Row regRow) {                   
        boolean result = false;
        int r = (Integer)ObjectUtil.findNewCell(regRow, "RI", "R").getColumnValue();
        int ri = (Integer)ObjectUtil.findNewCell(regRow, "RI", "RI").getColumnValue();
        DAO dao = DAO.getInstance();
        dao.query(Resources.REGS_MANAGER_R_RI_SQL);
        dao.setInt(1, r);
        dao.setInt(2, ri);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                result = rs.getBoolean("STATUS");
            }
            rs.close();
View Full Code Here

        }
        return result;
    }
   
    private void updateRPN() {
        DAO dao = DAO.getInstance();
        dao.update(Resources.DELETE_ALL_RPN_SQL);
        dao.executeUpdate();
        ClearRegsManagerTableModel model = (ClearRegsManagerTableModel)table.getModel();
        Vector datas = model.getDataVector();
        Iterator rowDatasIter = datas.iterator();
        while (rowDatasIter.hasNext()) {
            Vector rowDatas = (Vector)rowDatasIter.next();
            Item cleared = (Item)rowDatas.get(0);
            if (cleared.getFactValue().equals("Close")) {
                Row regRow = (Row)rowDatas.get(rowDatas.size() - 1);
                int r = (Integer)ObjectUtil.findNewCell(regRow, "RI", "R").getColumnValue();
                int ri = (Integer)ObjectUtil.findNewCell(regRow, "RI", "RI").getColumnValue();
                dao.update(Resources.INSERT_RPN_SQL);
                dao.setInt(1, r);
                dao.setInt(2, ri);
                dao.executeUpdate();
            }
        }
    }
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.