ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: I want ask you a problem about ibatis.
Date Tue, 16 Aug 2005 15:38:37 GMT
John,


This is really a simple Java issue.

When you say that it is not a file you are correct.  It is just a  
java.lang.btye[].  But on the other hand a java.io.File is not a file  
either.  It is just a pointer to the actual files in your  
filesystem.  If you want to write the byte[] out to a new file on  
your filesystem just use simple file io.

Something like ......


OutputStream out = new FileOutpuStream(new File(<file_name_goes_here>));

byte[] bytes = new byte[1024];
int bytesRead;

while ((bytesRead = in.read(bytes)) != -1) {
     out.write(bytes, 0, bytesRead);
}

out.close();


Nathan

On Aug 16, 2005, at 4:10 AM, John Li wrote:

> dear :
> I have read your aticle named How do I use a BLOB or CLOB?
> Thank you for your article,but I have a doubt about it.
> You tell me how to insert and update the record use a blob or  
> clob.But I don't  know how to get a record ?
> I only get a object with byte[],but it isn't a file.
> How can I convert it to file?
> please help me .Thank you.
> regards,
> John
>


Mime
View raw message