Package net.helipilot50.stocktrade.services

Examples of net.helipilot50.stocktrade.services.CustomerMgr


        Connection connection = null;
        try {
            connection = this.getConnection();
            ResultSet rs = connection.getMetaData().getTables(null, null, pName, null);
            while (rs.next()) {
                tableNames.add(new TextData(rs.getString(3)));
            }
        } catch (SQLException e) {
            throw new UsageException(e);
        } finally {
            releaseConnection(connection);
View Full Code Here


        int systemID = getLastIID();

        ConfigValueInst archName = new ConfigValueInst();
        archName.getName().setValue("Architecture");
        archName.updateData(new TextData(System.getProperty("os.arch")));
        archName.setIsReadOnly(true);
        archName.setInstrumentID(systemID + 1);
        this.addInstrument(archName);

        ConfigValueInst modelNode = new ConfigValueInst();
        modelNode.getName().setValue("ModelNode");
        modelNode.updateData(new TextData("false"));
        modelNode.setIsReadOnly(true);
        modelNode.setInstrumentID(systemID + 2);
        this.addInstrument(modelNode);

View Full Code Here

            Stream outStream) {
            int systemIndex = CommandIndexValues.AGENT_CMD_LASTVALUE;
            int index = cmdIndex - systemIndex;
            switch (index){
            case MOD_LOGGER_REMOTE_INDEX:{
                TextData flags = (TextData)parameters.get(0);
                modLoggerRemote(flags.toString());
                return null;
            }
            case MOD_LOG4J_REMOTE_INDEX:{
              TextData logger = (TextData)parameters.get(0);
                TextData level = (TextData)parameters.get(1);
                modLog4JRemote(logger.toString(), level.toString());
                return null;
            }
            case EXEC_CMD_REMOTE_INDEX:{
                try {
                  TextData command = (TextData)parameters.get(0);
                    Runtime.getRuntime().exec(command.toString());
                    return null;
                } catch (IOException e) {
                    return e.getMessage();
                }
            }
View Full Code Here

            this.orientation = or;
            this.firePropertyChange("orientation", oldValue, this.orientation);
            updateSize();
            break;
        default:
            UsageException errorVar = new UsageException("The value " + or + " cannot be set as the orientation on a RadioList");
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
    }
View Full Code Here

            this.layoutPolicy = pPolicy;
            this.firePropertyChange("layoutPolicy", oldValue, this.layoutPolicy);
            updateSize();
            break;
        default:
            UsageException errorVar = new UsageException("The value " + pPolicy + " cannot be set as the orientation on a RadioList");
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
    }
View Full Code Here

            CachedRowSet rowSet = new CachedRowSetImpl();
            rowSet.populate(pResults);
              this.resultSet = rowSet;
          }
          catch (SQLException e) {
                UsageException errorVar = new UsageException(e.getMessage(), SP_ER_USER, SP_ER_PARAMETERERROR, e);
                ErrorMgr.addError(errorVar);
                throw errorVar;
          }
        }
        else {
View Full Code Here

        return resultSet.findColumn(pColName);
      } catch (SQLException e) {
        // Ignore the exception because one will be raised below
      }
      }
        UsageException errorVar = new UsageException("Could not find ordinal for " + pColName);
        ErrorMgr.addError(errorVar);
        throw errorVar;
    }
View Full Code Here

              // At this stage setting the UDS Data Type to Unknown. May need to create a mapping from the JDBC DataType to a DB_DT_ constant
              cds.add(new DBColumnDesc(result.getInt("COLUMN_SIZE"), 0, result.getInt("DATA_TYPE"), result.getString("COLUMN_NAME"), result.getBoolean("NULLABLE"), result.getInt("DECIMAL_DIGITS")));
              columnCount++;
            }
            if (columnCount == 0) {
              UsageException errorVar = new UsageException("Cannot get column List from table: " + this.tableName + ", Table does not exist.");
              ErrorMgr.addError(errorVar);
              throw errorVar;
            }
            }
            // TF:24/07/2008:Added support for columns descriptors on input data sets too
            else if (statement != null && this.inputColMapping != null) { //PM:Aug 15, 2008:added null check on inputColMapping
              // It's possibly a request for the column list off the input metadata
              ParameterMetaData data = null;
              try {
                data = statement.getParameterMetaData();
              }
              catch (Exception e) {
                // No dice, go with what we've got
              }
              int numCols = this.inputColMapping.size();
              for (int i = 0; i < numCols; i++) {
                String name =  ":" + this.inputColMapping.get(i);
                int type = Types.OTHER;
                try {
                  if (data != null) {
                    type = data.getParameterType(i);
                  }
                }
                catch (Exception e) {}
                int scale = 2;
                try {
                  if (data != null) {
                    scale = data.getPrecision(i);
                  }
                }
                catch (Exception e) {};
                cds.add(new DBColumnDesc(4, type, type, name, false, scale));
              }
            }
            else if (resultSet != null) {
              ResultSetMetaData data = this.resultSet.getMetaData();
                int numCols = data.getColumnCount();
                // AD:24/09/08 Column Count starts at 1 not 0
                for (int i = 1; i <= numCols; i++) {
                    cds.add(new DBColumnDesc(data, i));
                }
            }
        } catch (SQLException e) {
            DataAccessException errorVar = new SQLErrorCodeSQLExceptionTranslator().translate("Cannot get column List from result set\n" + e.getMessage(), "", e );
            ErrorMgr.addError(errorVar);
            throw errorVar;
            // PM:16/07/2008
        } catch (NullPointerException e){
          String msg = (e.getMessage() == null) ? e.getClass().getName() : e.getMessage();
            UsageException errorVar = new UsageException("Cannot get column List from result set\n" + msg , e );
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
        return cds;
    }
View Full Code Here

            } else if (pValue instanceof BinaryData) {
              BinaryData value = (BinaryData) pValue;
              cachedRowSet.updateBinaryStream(pColOrdinal, new ByteArrayInputStream(value.getValue()), value.getActualSize());
            }
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), net.helipilot50.stocktrade.framework.Constants.SP_ER_USER, net.helipilot50.stocktrade.framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
        }
      }
View Full Code Here

        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateInt(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), net.helipilot50.stocktrade.framework.Constants.SP_ER_USER, net.helipilot50.stocktrade.framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
        }
      }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.services.CustomerMgr

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.