wood burning stoves 2.0*
The moose likes Servlets and the fly likes uploading image into myslq through servlet WAS: uploading image into oracle database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "uploading image into myslq through servlet WAS: uploading image into oracle database " Watch "uploading image into myslq through servlet WAS: uploading image into oracle database " New topic
Author

uploading image into myslq through servlet WAS: uploading image into oracle database

michael dizon
Greenhorn

Joined: Jul 12, 2002
Posts: 4
Scott Duclos was kind enough to show me how to upload an image into an oracle database. Only now I discovered that it must be inserted into a mysql database instead.
So how does one insert an image into mysql through a servlet? I'm assuming that much will be the same as what is posted in Scott's post, but there seems to be alot of reliance on the oracle api.
Scott Duclos
Greenhorn

Joined: Jul 12, 2002
Posts: 3
Mike, I'm not sure of the exact code to insert into MySQL, but this
will probably work. Turn the image into a base64 encoded String so that
it can easily be stored in a large character field in MySQL. Then decode
when the image is selected out. This should work with most Databases.
If performance is a major issue then this might not be the best solution as
there is the extra decode step.
--- Images --------------
image_id NUMBER( 14 )
image_name VARCHAR2( 50 )
image CLOB or the equivalent in MySQL
-------------------------

---- Upload image servlet --------

Scott
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: uploading image into myslq through servlet WAS: uploading image into oracle database
 
Similar Threads
how to store/retrive image in oracle database using struts 1.2
How to Upload an image to the database?
Displaying image from a BLOB stored in DB
How Upload Image to DataBase
Upload files of size more than 100mb