title: trying to insert image into database getting ORA-01460: unimplemented or unreasonable conversion requested error
body: <p>I'm trying to insert an image into database and with auto increment photo_id.</p>
  
  <p>my table columns are: </p>
  
  <pre><code>PHOTO_ID  (primary key),
  USERNAME  (fkey),
  PICTURE,
  PICTURE_TITLE,
  LIKES 
  </code></pre>
  
  <p>my code is </p>
  
  <pre><code>public class UploadPhotoDao {
      public int insertPhoto(UploadPhotoBean uploadBean){
          Connection con = null;
          PreparedStatement ps = null;
  
          int index = 0;
          final String query = "INSERT INTO PHOTOS_DETAILS (PHOTO_ID,USERNAME,PICTURE,PICTURE_TITLE,LIKES) VALUES (PHOTO_ID_SEQUENCE.nextval,?,?,?,?)";
              try {
                  con = ConnectionUtil.getConnection();
                  ps = con.prepareStatement(query);
  
  
                  ps.setString(1, uploadBean.getUsername());
                  File file =new File(uploadBean.getPicture());
                  FileInputStream fis = new FileInputStream(file);
                  ps.setBinaryStream(2, fis, fis.available());
                  ps.setString(3, uploadBean.getPictureTitle());
                  ps.setInt(4, new Integer(0));
                  index = ps.executeUpdate();
  
              }
              catch (SQLException e) {
                  e.printStackTrace();
              } catch (FileNotFoundException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } 
              finally {
                      ConnectionUtil.closeQuitly(ps);
                      ConnectionUtil.closeQuitly(con);
              }
              return index;
      }
  }
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <pre>
  java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested
  </pre>