the above code is inserting image....i don't know the above code is right or not.. but it insert record in table;
It inserted a record alright, but not with the image. You gave the record two values: a 1, and the file length. That's two integer values, not the image itself. I said you should use a PreparedStatement; I don't see any.
I was thinking about the following:
Don't forget to close() fis, preferably using a try-finally block.
Joined: Apr 07, 2010
I have done code for inserting image as per your instruction...
now what to do for retriving image on JSP..
what to write in Action Class to retrive image and On jsp page...??
hey Rob i have one question.....
before doing this i have tried for storing image on local disk....
it is working on my machine perfactly....
but when i am accessing from another machine the image is not coming.... then i got solution like on another machine first i have to access my machine from RUN....then i gave username/password for my machine .
and on my machine i have put folder of image in shared.
then it will allow and work perfactly...
but this solution is not good there for i am moving for storing image in database...
is there any posibility to access image from local disk without accessing (from RUN) my machine from client machine..?
and one thing is that i am working on windows environment... where as my deployment server is linux environment..
i am using jboss-4.0.4RC1 application server..
subject: how to store/retrive image in oracle database using struts 1.2