예제 #1
0
 public byte[] getByteValue(ResultSet resultSet, int nCol1Based, boolean bEbcdicOutput) {
   try {
     String csValue = resultSet.getString(nCol1Based);
     byte[] aBytes = csValue.getBytes();
     if (bEbcdicOutput) // Must outout in ebcdic
     AsciiEbcdicConverter.swapByteAsciiToEbcdic(aBytes, 0, aBytes.length);
     return aBytes;
   } catch (SQLException e) {
     return null;
   }
 }
예제 #2
0
 public byte[] getExcelValue(ResultSet resultSet, int nCol1Based, boolean bEbcdicOutput) {
   try {
     String csValue = resultSet.getString(nCol1Based);
     csValue = csValue.trim().replace("\"", "'");
     if (csValue.length() == 0) csValue = " ";
     csValue = "\"" + csValue + "\"";
     byte[] aBytes = csValue.getBytes();
     if (bEbcdicOutput) // Must outout in ebcdic
     AsciiEbcdicConverter.swapByteAsciiToEbcdic(aBytes, 0, aBytes.length);
     return aBytes;
   } catch (SQLException e) {
     return null;
   }
 }
예제 #3
0
  public int setByteValueInStmtCol(
      DbColDefErrorManager dbColDefErrorManager,
      DbPreparedStatement stmt,
      int nCol,
      byte arrByteValue[],
      int nSourceOffset,
      boolean bEbcdicInput) {
    if (bEbcdicInput) // Must outout in ebcdic
    AsciiEbcdicConverter.swapByteEbcdicToAscii(arrByteValue, nSourceOffset, m_nLength);
    String csValue = new String(arrByteValue, nSourceOffset, m_nLength);
    stmt.setColParam(nCol, csValue);

    return m_nLength;
  }