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.
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 --------
subject: uploading image into myslq through servlet WAS: uploading image into oracle database