Package realcix20.utils

Examples of realcix20.utils.DAO


   
    private PublicKey getPublicKey() {
       
            PublicKey publicKey = null;
       
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_KEYPAIR_SQL);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next())
                    publicKey = (PublicKey)rs.getObject("PUBKEY");
                rs.close();
            } catch (Exception e) {
View Full Code Here


    private PrivateKey getPrivateKey() {
       
       
            PrivateKey privateKey = null;
       
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_KEYPAIR_SQL);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next())
                    privateKey = (PrivateKey)rs.getObject("PRIKEY");
                rs.close();
            } catch (Exception e) {
View Full Code Here

   
    public static String getBalanceLD() {
       
            String balanceLD = null;           
            String lt = "X";
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_DEFLD_SQL);
            dao.setObject(1, lt);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next()) {
                    balanceLD = rs.getString("DEFLD");
                }
                rs.close();
View Full Code Here

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

       
    }
   
    public static void deleteRI(int r) {
       
            DAO dao = DAO.getInstance();
            dao.update(Resources.DELETE_RI_SQL);
            dao.setInt(1, r);
            dao.executeUpdate();
       
    }
View Full Code Here

       
    }
   
    public static void deleteR(int r) {
       
            DAO dao = DAO.getInstance();
            dao.update(Resources.DELETE_R_SQL);
            dao.setInt(1, r);
            dao.executeUpdate();
       
    }      
View Full Code Here

                }
                if (!findComponent) {
                    Vector parameters = relationManager.getParameters(childComponentExt);
                    if (parameters != null) {
                        String sql = relationManager.getSQL(childComponentExt, parameters);
                        DAO dao = DAO.getInstance();
                        dao.query(sql);
                        for (int i = 0; i < parameters.size(); i++) {

                            String parameter = (String)parameters.get(i);
                            StringTokenizer st = new StringTokenizer(parameter, ".");
                            String tableName = (String)st.nextElement();
                            String columnName = (String)st.nextElement();
                            ComponentExt tempComponentExt = relationManager.findComponentExt(tableName, columnName);
                            JComponent tempComponent = tempComponentExt.getComponent();                                   
                            dao.setObject(i+1, ComponentManager.getValue(tempComponent));

                        }
                        ResultSet rs = dao.executeQuery();
                        try {                                   
                            if (rs.next()) {
                                ResultSetMetaData rsmd = rs.getMetaData();
                                for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                                    ComponentExt tempComponentExt = relationManager.findComponentExt(column.getTableName(), rsmd.getColumnName(i));
View Full Code Here

                whereValues.add(ObjectUtil.findNewCell(row, pkColumn.getTableName(), pkColumn.getColumnName()).getColumnValue());
            }
        }
        sb.delete(sb.lastIndexOf("AND"), sb.lastIndexOf("AND") + 3);
        String sql = sb.toString();
        DAO dao = DAO.getInstance();
        dao.query(sql);
        for (int i = 0; i < whereValues.size(); i++) {
            dao.setObject(i + 1, whereValues.get(i));
        }
        ResultSet rs = dao.executeQuery();
        try {
            while (rs.next()) {
                Row childRow = new Row(rs);
                row.getRowSet().getRows().add(childRow);
                getRows().add(childRow);
View Full Code Here

            sb.delete(sb.lastIndexOf(","), sb.lastIndexOf(",") + 1);
            sb.append(")");
            String sql = sb.toString();
           
            //Insert rows
            DAO dao = DAO.getInstance();
            dao.update(sql);
            dao.setAutoCommit(false);
           
            int currentParameter = 1;
            columnIter = columns.iterator();
            while (columnIter.hasNext()) {
                Column column = (Column)columnIter.next();
                if (column.getTableName().equals(mainTableName)) {
                    Object value = getNewCellValue(column, row);
                    dao.setObject(currentParameter, value);
                    currentParameter++;
                }
            }
           
            result = dao.executeUpdate();
           
            if (test) {
                dao.rollback();
            }
            else {
                if (!result) {
                    dao.rollback();
                }
                else {
                   
                    dao.commit();
                   
                    if (isSlayerMaster()) {
                    
                        Iterator rowIter = row.getRowSet().getRows().iterator();
                        while (rowIter.hasNext()) {

                            Row childRow = (Row)rowIter.next();
                            if (childRow != row) {
                                if (!childRow.isDelete())
                                    classInsert_Child(childRow, false);
                            }

                        }
                       
                    }                                                       
                   
                }                   
            }
           
            dao.setAutoCommit(true);
                       
            return result;
       
    }
View Full Code Here

            sb.delete(sb.lastIndexOf(","), sb.lastIndexOf(",") + 1);
            sb.append(")");
            String sql = sb.toString();
           
            //Insert rows
            DAO dao = DAO.getInstance();
            dao.update(sql);
            dao.setAutoCommit(false);
           
            int currentParameter = 1;
            columnIter = columns.iterator();
            while (columnIter.hasNext()) {
                Column column = (Column)columnIter.next();
                if (column.getTableName().equals(tableName)) {                   
                    Object value = getNewCellValue(column, row);
                    dao.setObject(currentParameter, value);
                    currentParameter++;
                }
            }
           
            result = dao.executeUpdate();
           
            if (test)
                dao.rollback();
            else {
                if (!result)
                    dao.rollback();
                else
                    dao.commit();
            }
           
            dao.setAutoCommit(true);
           
            return result;
       
    }
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.