Thanks for the reply.

Have any ideas then how to convert or cast a byte[] to a Blob?
I've tried multiple ways but so far no luck and I don't think I want to go 
from byte array to string to Blob.

Any ideas would be appreciated.

Thank You

Here's a snippet of my code:

import java.sql.*;
import java.math.BigDecimal;
//import org.apache.commons.codec.binary.Hex;
//import org.apache.commons.codec.binary.Base64;
//import org.apache.commons.codec.DecoderException;

  public void history(

    // input parameter(s)

    String              parmWhere,

    // output columns

        String          Transactioncode,
        String          OrderNumber,
        String          ItemNumber,
        String          Warehouse,
        Blob            TokenBlob)      // Have tried String

  throws Exception {

        byte [] TokenUsedToUniquelyIdentifyRecord;

String sql="SELECT " +
          "Transactioncode, " +
          "OrderNumber, " +
          "ItemNumber, " +
          "Warehouse, " +
          "TokenUsedToUniquelyIdentifyRecord, " +
  "FROM Inventory.dbo.Inventory_History " +
  (parmWhere.equals("")?"":"WHERE " + parmWhere); 

// Read the SQL Server "binary" column as a byte array in Java then 
convert or cast it to a DB2 Blob
// Type mismatch: Cannot convert from byte[] to a Blob
TokenBlob = rs.getBytes("TokenUsedToUniquelyIdentifyRecord"); 
 set(58, TokenBlob);

The information contained in this message, and any attachments, are or may 
be privileged and/or confidential and protected from disclosure and may 
also be covered by the Electronic Communications Privacy Act, 18 U.S.C. 
2510-2521. If the recipient of this message is not the intended recipient 
or authorized to receive this information for the addressee, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this 
communication in error please delete it from your computer immediately.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.