File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJBs, Webcontainer and *Images*... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJBs, Webcontainer and *Images*..." Watch "EJBs, Webcontainer and *Images*..." New topic
Author

EJBs, Webcontainer and *Images*...

V. Rentschler
Greenhorn

Joined: Feb 23, 2009
Posts: 5
Hi folks,

This is the situation: I am developing a business application with EJB3 and Glassfish as server. There will be a webshop communicating with EJBs, furthermore a Java desktop client which will be used for inserting products etc... (i.e.: the web-tier should only be used to view and order products). The database (MySQL) connection is realised via iBatis.
So far, so good, so simple. Now I have one problem: storing images.

Any suggestions how to do this properly? Storing blobs into the database will not be allowed to me by the guys who develop and run the database. (But I would be thankful for comments on that account, too).

Thanks in advance,
Val
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Val,
There are two logical places to store images - on the file system or in the database. It sounds like your database team already made the decision for you. You might want to ask them why - just to be sure.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
V. Rentschler
Greenhorn

Joined: Feb 23, 2009
Posts: 5
Jeanne Boyarsky wrote:Val,
There are two logical places to store images - on the file system or in the database. It sounds like your database team already made the decision for you. You might want to ask them why - just to be sure.


"Scalability"... I'm not really sure about the pros and cons of it really...
File system does sound logical, I know you can technically do it (because I actually just tried), but it's disencouraged by the specification for good reasons... so just what is the "way to go"?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

The spec says EJBs shouldn't access the file system. Which you wouldn't. You would pass back the absolute path and the servlet would access the file system.
V. Rentschler
Greenhorn

Joined: Feb 23, 2009
Posts: 5
But what If I want to read and write files from the server, to display them over a desktop client..?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJBs, Webcontainer and *Images*...