You can always add methods in individual objects to escape into JDBC
directly. This is probably the easiest way, since you can use the methods
on ResultSet directly.
Working with BLOBs like this is kinda ugly, because you generally have to do
it in a transaction (autocommit off) and you have to keep your connection
open while reading the stream. So if you wanted to hide this in a method
like
MyObject:
public InputStream getColumnAsStream()
Connection conn = get conn;
Statement stmt = conn.createStatement()
ResultSet rs = stmt.executeQuery("select ...");
rs.next();
return rs.getBlob(1).getInputStream();
somehow you'd have to keep the connection open and close it later only when
you're done with the input stream. Ick.
-- Bill
----- Original Message -----
From: "Harry Lamer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 22, 2002 8:04 AM
Subject: BLOBs & Streams
> Hi,
>
> in our project we have a table which contains a BLOB. To access this table
> with Torque the "typical" way is no problem. (To store the BLOB data in a
byte
> array in the class Torque has generated for us).
> But since this BLOB can be as large as 10MByte we don't want to load the
> whole BLOB into Memory but to use it's In-/Outputstreams to read/write the
data.
>
> Any ideas how to solve that with Torque?
>
> Thanks.
> _____
> Harry
>
> --
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>