You can try looking into the javax.imageio package. Get the byte stream/blob from the result set and use that stream to create an encoded image. But your system is dependent on the host machine's graphics context and you may not be able to guarantee any given format for all installations of the swing application.
You can try this: BufferedImage image1 = ImageIO.read ( new ByteArrayInputStream ( rawImageBytes ) ); ImageIO.write(image1, "jpeg" /* "png" "jpeg" format desired, no "gif" yet. */ , new File ( "abc.jpg" ) /* target */ ); Regards, Partha ---------- From: [Vinod Kumar] [SMTP:[EMAIL PROTECTED] Sent: Thursday, August 12, 2004 10:17 AM To: [EMAIL PROTECTED] Subject: Re: Upgrading from an old Servlet HI guys I have a small problem. I am working on java swings with sql server for backend I have some images stored in SQL server db as type image. It can be anything Currently I have a program to insert any image into the db But I am finding it tough to read an image back from the database and use it in Can somedbody tell me how to do it (the formate of the file can be anything BMP,GIF ,JPEG etc.) And provide some sample code Thanks and regars Vinod Kumar Project Engineer Wipro Technologies Banglore 560 068 -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] On Behalf Of Peter Claesson (CA/EUS) Sent: Wednesday, August 11, 2004 11:36 PM To: [EMAIL PROTECTED] Subject: Upgrading from an old Servlet This is a newbie question to SDK 1.4.2. I've been tasked to move forward a solution we did for supporting Thai characters using ServletExec. Well, the new version of SE (5.0) supports Servlet Spec 2.4. I'm trying to upgrade my old design environment from using SDK 1.3.1 and and an older servlet.jar from 2000 (ver 1.2.2??). I'm having a problem of finding where equivalent jar file in the new 1.4.2 SDK (EE) to updade my classpath. Can someone give me a pointer if the packaging of the jar file has changed, and if so, to what? Thanks. /Peter ________________________________________________________________________ ___ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. ********************************************************************* ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html