After a long trial ,I finally successfully able to upload an image to an oracle database. At least my code says so. However to check whether the image has been successfully I wrote a servlet. After running the servlet I get a black screen in my browser and nothing else. The servlet code is:
By the way, as I am totally new to this, I took extensive help from this link.http://www.srikanthtechnologies.com/blog/java/fileupload.aspx.
EDIT : I get the black screen if only viewed from FF , but if viewed from internal web browser of Eclipse it shows me a single word upload . Very strange behavior!! Please help!!
You're still not doing it right. You are now reading data twice in each loop iteration. The data read by the first one will be discarded and overwritten by the data read by the second one. Also, you write all contents of the byte, even if less was read. Didn't you check the link I posted? It shows you exactly how you can do this.