title: context.getMimeType() returns null and inputStream.available() returns 0 in servlet
body: <p>ResultSet result = statement.executeQuery();</p>
  
  <pre><code>        if (result.next()) {
              // gets file name and file blob data
              String fileName = result.getString("Name");
  
              Blob blob = result.getBlob(3);
  
              InputStream inputStream = blob.getBinaryStream();
  
              int fileLength = inputStream.available();
  
        //      out.println("fileLength = " + fileLength);
  
  
              ServletContext context = getServletContext();
  
              // sets MIME type for the file download
  
              String mimeType = context.getMimeType(fileName);
         //     String mimeType = "image/jpeg";
  
  
              if (mimeType == null) {        
                  mimeType = "application/octet-stream";
              }    
  </code></pre>
  
  <p>I am trying to download data from a database. Im using Oracle. What am i doing wrong here?</p>
  
  <p>context.getMimeType always returns null and inputStream.available() always returns 0.</p>
  
  <p>I looked at other answers but they were not relevant to me. Please help.</p>