aspose file tools *
The moose likes JSF and the fly likes store image in mysql using visual jsf in netbeans 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "store image in mysql using visual jsf in netbeans 6" Watch "store image in mysql using visual jsf in netbeans 6" New topic
Author

store image in mysql using visual jsf in netbeans 6

montyfirst disuzafirst
Greenhorn

Joined: Jan 11, 2009
Posts: 4
HI friends
i am new to this forum and i came to know that all members of this forum are very great;
can any one tell me how to store image in mysql using visual web jsf .. netbeans 6(ide)

please help asap my project is delayed because of this problem...


:P byeee
Lars Arnbak
Greenhorn

Joined: Dec 22, 2008
Posts: 4
I dont know Netbeans or visual jsf..

But storing images in a db, is to some extend, the same as storing text or some other stuff. You have to define the datatype for the field holding the image information/content.

In mySql, table fields for holding image data or object data should be of type blob.

Have a look at what google gives you on that search string:
http://www.google.dk/search?q=Storing+Images+In+MySQL+&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

That should certainly give you a push in the right direction.

Regards.


Later equals never!
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You normally don't use JSF to store an image in a DB. You normally use JDBC for that.

If your actual problem is that you don't know how to upload a file (image) with JSF, then you should say that so. There are component libraries out for uploading files with JSF, for example Tomahawk t:inputFileUpload. Just get an InputStream of the uploaded file and persist it in the DB using JDBC's PreparedStatement#setBinaryStream().
 
 
subject: store image in mysql using visual jsf in netbeans 6