Package net.helipilot50.stocktrade.framework

Examples of net.helipilot50.stocktrade.framework.BinaryNullable$qq_Resolver


              cachedRowSet.updateBoolean(pColOrdinal, value.getBooleanValue());
            } else if (pValue instanceof DateTimeData) {
              DateTimeData value = (DateTimeData) pValue;
              cachedRowSet.updateDate(pColOrdinal, new Date(value.asDate().getTime()));
            } 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


            // TF:23/02/2009:JIRA DET-75:handle binary data within the database
            case Types.BLOB:
            case Types.BINARY:
            case Types.LONGVARBINARY:
            case Types.VARBINARY:
              BinaryNullable value = this.getBinaryNullable(pColumnID);
              if (value.isNull() && pDataValue.isNullable()) {
                pDataValue.setIsNull(true);
              }
              else if (TextData.class.isAssignableFrom(classType)){
          if (value.isNull()) {
            ((TextData)pDataValue).setValue("");
          } else {
            ((TextData)pDataValue).setValue(value.toString());
          }
        } else {
          ((BinaryData)pDataValue).setValue(value);
        }
              break;
View Full Code Here

          this.metaData = this.resultSet.getMetaData();
        }
        if (this.metaData.getColumnType(ColumnID) == Types.BLOB) {
          Blob theBlob = resultSet.getBlob(ColumnID);
              if (theBlob == null || resultSet.wasNull()) {
                return new BinaryNullable(true, BinaryNullable.qq_Resolver.cISNULL);
              }
              else {
                byte[] byteArray = theBlob.getBytes(1, (int)theBlob.length());
                return new BinaryNullable(byteArray);
              }
        }
        else {
              byte[] byteArray = resultSet.getBytes(ColumnID);
 
              if (byteArray == null || resultSet.wasNull()) {
                return new BinaryNullable(true, BinaryNullable.qq_Resolver.cISNULL);
              }
              else {
                  return new BinaryNullable(byteArray);
              }
        }
        }
        catch (SQLException e) {
              throw processException(e);
View Full Code Here

        try {
            //Blob theBlob = resultSet.getBlob(pColumnName);
            byte[] byteArray = resultSet.getBytes(pColumnName);

            if (byteArray == null || resultSet.wasNull()) {
                BinaryNullable result = new BinaryNullable();
                result.setIsNull(true);
                return result;
            }

            else {
                // byte[] byteArray = theBlob.getBytes(1, (int)theBlob.length());
                return new BinaryNullable(byteArray);
            }
        } catch (SQLException e) {
          throw processException(e);
        }
    }
View Full Code Here

    // We're already closed, just discard the result set if any
    resultSet = null;
  }
 
  public boolean execute() throws SQLException {
    final BooleanData result = new BooleanData();
    useRealStatement(new StatementWorker() {
      public void doWork(PreparedStatement ps) throws SQLException {
        result.setValue(ps.execute());
       
        // Now get the results sets and remember them
        populateResults(ps, result.getValue());
      }
    });
    return result.getValue();
  }
View Full Code Here

    });
    return updateCount;
  }

  public boolean execute(final String sql) throws SQLException {
    final BooleanData result = new BooleanData();
    useRealStatement(new StatementWorker() {
      public void doWork(PreparedStatement ps) throws SQLException {
        result.setValue(ps.execute(sql));
       
        // Now get the results sets and remember them
        populateResults(ps, result.getValue());
      }
    });
    return result.getValue();
  }
View Full Code Here

    });
    return result.getValue();
  }

  public boolean execute(final String sql, final int autoGeneratedKeys) throws SQLException {
    final BooleanData result = new BooleanData();
    useRealStatement(new StatementWorker() {
      public void doWork(PreparedStatement ps) throws SQLException {
        result.setValue(ps.execute(sql, autoGeneratedKeys));
       
        // Now get the results sets and remember them
        populateResults(ps, result.getValue());
      }
    });
    return result.getValue();
  }
View Full Code Here

              cachedRowSet.updateDouble(pColOrdinal, doubleValue.getDoubleValue());
            } else if (pValue instanceof DecimalData) {
              DecimalData value = (DecimalData) pValue;
              cachedRowSet.updateBigDecimal(pColOrdinal, value.getBigDecimal());
            } else if (pValue instanceof BooleanData) {
              BooleanData value = (BooleanData) pValue;
              cachedRowSet.updateBoolean(pColOrdinal, value.getBooleanValue());
            } else if (pValue instanceof DateTimeData) {
              DateTimeData value = (DateTimeData) pValue;
              cachedRowSet.updateDate(pColOrdinal, new Date(value.asDate().getTime()));
            } 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

      lastCID = id;
    }
    //PM:04/09/2008:Adding modifiable config instruments as operations
    protected void addCommandForAttribute(Instrument inst){
      if (inst instanceof ConfigValueInst){
        CommandDesc desc = new CommandDesc();
            desc.setCmdName("set" + inst.Name.asString());
            desc.setArgDesc("s");
            desc.setCmdIndex((short) (getLastCID() + 1000 + inst.getInstrumentID()));
            desc.setHelpText("set the value of " + inst.Name.asString());
            desc.setCmdFlags((short)1);
            desc.setArgNames("set " + inst.getName());
            desc.setGroupName("");
            desc.setMenuString("Utility");
        processOneCommandDescriptor(desc);
      }
    }
View Full Code Here

        processOneCommandDescriptor(desc);
      }
    }
    protected void removeCommandForAttribute(Instrument inst){
      if (inst instanceof ConfigValueInst){
        CommandDesc desc = new CommandDesc();
            desc.setCmdName("set" + inst.Name.asString());
            desc.setArgDesc("s");
            desc.setCmdIndex((short) (getLastCID() + 1000 + inst.getInstrumentID()));
            desc.setHelpText("set the value of " + inst.Name.asString());
            desc.setCmdFlags((short)1);
            desc.setArgNames("set " + inst.getName());
            desc.setGroupName("");
            desc.setMenuString("Utility");
        removeOneCommandDescriptor(desc);
      }
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.BinaryNullable$qq_Resolver

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.