Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 4th, 2007, 11:41 PM
Registered User
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kiran_p2p
Default Problem While Storing image File

Hi Every Body.........

here iam working wth swings..
i am getting a problem while storing image file into data base.

my dayabase contains:
studentID varchar(30)
photo mediumblob nullallowed.
i am using bean class. to handle database.and i'm using map.
************************************************** ****
my setter method is:
setPhoto(File f)
hsm.put("photo",FileIn);//here i am using map.
************************************************** *****
And My Bean Class is....

 Map.Entry me=(Map.Entry)ir.next();
Object key = me.getKey(); // Get the next key.
 Object value =me.getValue();
 if(value instanceof File)
System.out.println("Enter The Dragon...");
File fone=(File)value;
InputStream streamedFile = new FileInputStream(fone);
int len=(int)fone.length();
System.out.println("File Length is........"+len);
ps.setBinaryStream(i,(InputStream)streamedFile,len );/////[u]here i am gettimg exception........Please Give idea /////</u>System.out.println("edbc Excecuted...");
catch(Exception e)
{System.out.println("Error While Converting Image File..."+e.toString());
************************************************** *********
i amgetting exception in setBiaryStream();

Please Give me Solution
Thanks in Advance


Similar Threads
Thread Thread Starter Forum Replies Last Post
storing image url in sql 2000 sbushe Classic ASP Databases 0 January 28th, 2008 02:28 PM
problem retreivig image from file stream sanjeet General .NET 0 September 23rd, 2005 04:31 PM
Uploading an image and storing its name in a DB SKE Classic ASP Databases 1 March 14th, 2005 09:13 AM
Storing Graphic Image on Sql Server kasie ADO.NET 3 March 27th, 2004 04:51 AM
storing an image in a database nagdandey Classic ASP Databases 2 December 17th, 2003 05:39 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.