ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soussou97 <dbousse...@yahoo.fr>
Subject Re: Scanning byte array
Date Mon, 02 Oct 2006 08:02:05 GMT

Hi Nathan;

Yes I would like to display the data via a GUI, so how I use a buffered
reader to read the data ? Have you a example ?

Thank's 


Nathan Maves-2 wrote:
> 
> When you say scan are you looking for some specific bytes?  If not
> just use a buffered reader to read and display the data.
> 
> On 9/29/06, soussou97 <dboussebha@yahoo.fr> wrote:
>>
>> Hi;
>>
>> I have a method which return a byte array from a BLOB (Oracle) :
>>
>> public static byte[] getBLOB(int id, Connection conn) throws Exception {
>>     ResultSet rs = null;
>>     PreparedStatement pstmt = null;
>>     String query = "SELECT data FROM Table1 WHERE id = ?";
>>     try {
>>       pstmt = conn.prepareStatement(query);
>>       pstmt.setInt(1, id);
>>       rs = pstmt.executeQuery();
>>       rs.next();
>>       Blob blob = rs.getBlob(1);
>>       return blob.getBytes(1, (int) blob.length());
>>     } finally {
>>       rs.close();
>>       pstmt.close();
>>       conn.close();
>>     }
>>   }
>>
>> }
>>
>> I must to scan the byte array position by position for extracting of the
>> data contained into this array for a display in using a GUI.
>> Which is the best (performance) solution to implemente this ?
>>
>> Regards;
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Scanning-byte-array-tf2356548.html#a6563833
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Scanning-byte-array-tf2356548.html#a6597309
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message