How to read original data bytes from a Sybase TEXT type column?

From: Ralf Lehmann (rlehmann_at_dynix.com)
Date: 10/30/03

  • Next message: bevyn quiding: "Re: jboss and ingres"
    Date: 30 Oct 2003 13:17:54 -0800
    
    

    I am trying to get the original bytes of data from a Sybase TEXT type
    column. The Sybase JDBC driver reads the data from the text column
    and does an automatic conversion to Unicode. I want the data bytes
    without the automatic conversion to Unicode. I have been able to do
    this with a VARCHAR, but not with a TEXT type column. Here is how I
    do it with a VARCHAR column (the "mydata" column is a VARCHAR(255) in
    this example):
     

    String query = "select convert(varbinary(255), mydata) mydata from
    mytable where recnum = 1" ;

    ResultSet rs = stmt.executeQuery( query );

    while( rs.next() )
    {
        byte[] myByteArray = rs.getBytes("firstname");

    }
     
    I have not been able to do something similar with a TEXT type column.
    Any suggestions?


  • Next message: bevyn quiding: "Re: jboss and ingres"