Re: Sending image into BLOL
From: Lee Fesperman (firstsql_at_ix.netcom.com)
Date: 10/21/03
- Next message: Dale: "Access database SQL query ?"
- Previous message: Chithu: "Exception : ResultSet is from UPDATE. No Data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 21 Oct 2003 05:24:18 GMT
Niki Iv wrote:
>
> Hello to All.
> The situation is as follows.
> I use javax.swing.filechooser.FileSystemView
> getSystemIcon to get the default OS icon.
> Now I need to send this Icon to a BLOB
> into database depending on it's extension.
> I don't knwo how to get BLOB (this is interface) instance
> from any suitable class. My first idea was to use PreparedStatement
> and setBlob().
> The second guess was to use
> PreparedStatement.setBinaryStream.. but I was unable to
> figure out how to get InputStream without writing the Image into file
> and then read this file.
> The third guess is to serialize the IconImage whch is serializable..
> but for setBinaryStream I need InputStream.. serializing give me
> output stream..
> Any ideas.....
Send either OutputStream to a ByteArrayOutputStream and then create a
ByteArrayInputStream from the resulting byte[] (retrieved using toByteArray() in
ByteArrayOutputStream).
-- Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
- Next message: Dale: "Access database SQL query ?"
- Previous message: Chithu: "Exception : ResultSet is from UPDATE. No Data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|