You can also use setBinaryStream() but there will be some limitations for that. I guess we cannot upload more than 4KB if we use setBinaryStream(). Any ways try out the following code...
org.apache.struts.upload.FormFile formfile=Fileinfo.getFile();
//The above step gets the formfile object from Fileinfo class.
PreparedStatement ps=null;
Connection con=Coredb.getConn();
try
{
String fileName=formfile.getFileName();
int fileSize=formfile.getFileSize();
byte bb[]=formfile.getFileData();
ps=con.prepareStatement("insert into fles values(?,?,?)");
ps.setString(1,fileName);
ps.setInt(2,fileSize);
ps.setBytes(3,bb);
}