posted 22 years ago
how to use getBinaryOutputStream() to retrieve gif file from oracle and display that gif file in the browser.
will any one help me.
I have written this coding. but i am not able to display the gif file in the browser.
sample code:
-----------
java.sql.ResultSet rset = stmt.executeQuery ("select picture from test1 where name='test2' for update");
BLOB blob=null;
int count=0;
while(rset.next ())
{
count++;
blob=((oracle.jdbc.driver.OracleResultSet)rset).getBLOB(1);
out.println(blob.length());
Object obj;
OutputStream ostream = blob.getBinaryOutputStream ();
java.io.ObjectOutputStream objs =new java.io.ObjectOutputStream(ostream);
objs.writeObject(obj);
}