When I run this code I get the following error messge java.sql.SQLException: Io exception: Connection reset by peer: socket write error.and when I try to retrieve the blob object I get a Nullpointer Exception.
@Sovan, What I think is you are trying to upload a file of larger size and your system is unable to keep a connection open long enough to upload the file successfully, try with small size files. While retrieving the BLOB object you are getting the NullPointerException, because you are trying to retrieve an object which does not exists (As the file is failing to upload in your case).
What version of driver (not type)? Oracle's 9i drivers were less than perfect - from memory (though this may only apply to LONG RAW data types) you needed to be careful what order you bound binary content variables.
If you are not already doing this, try swapping to the latest 11g driver.