Adam, thanks for pointing me this, after reading doc and few examles it works for me. I have found this source: https://svn.apache.org/repos/test/wicket/releases/wicket-1.2.1/wicket-exampl es/src/java/wicket/examples/captcha/JCaptcha.java where is nice example of using DynamicImageResource
Miro > -----Original Message----- > From: Adam Gray [mailto:[email protected]] > Sent: Saturday, 02. July 2011 14:42 > To: [email protected] > Subject: Re: image from data > > Perhaps check out DynamicImageResource? > > On Sat, Jul 2, 2011 at 7:39 AM, Miroslav F. <[email protected]> wrote: > > > Hi folks, > > > > I have images in database as BLOBs and retrieving it with JDBC (not > > good code, just test at the moment) with this (just snip of > the code): > > > > conn = Utils.makeConnection();//make connection with JDBC try { > > conn.setAutoCommit(false); > > st = conn.createStatement(); > > rs = st.executeQuery("SELECT * FROM testdatabase.images"); > > LargeObjectManager lobj = ((org.postgresql.PGConnection) > > conn).getLargeObjectAPI(); > > while(rs.next()) > > { > > Long oid = rs.getLong(7); > > LargeObject obj = lobj.open(oid, > LargeObjectManager.READ); > > byte buf[] = new byte[obj.size()]; > > obj.read(buf, 0, obj.size()); > > //-->now I have image data in buf[], how can > I put them > > into html? > > obj.close(); > > } > > rs.close(); > > st.close(); > > conn.commit(); > > } > > catch(SQLException e) > > { > > e.printStackTrace(); > > } > > > > How can I put this image data into html page? Save it as file onto > > file system and then insert in src atribute of img tag? Or > something > > else? Example is welcome. > > > > Thanks in advance, > > > > Miro > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
