Skip navigation links
Oracle® Multimedia Servlets and JSP Java API Reference
12c Release 2 (12.2)

E86002-01
D E G I L O P R S 

D

DEFAULT_BUFFER_SIZE - Static variable in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
The OrdHttpResponseHandler class uses a default buffer size of 32768 to retrieve LOB data from the database and deliver it to the client.
destroy() - Method in class oracle.ord.im.OrdMultipartFilter
Deprecated.
Implements the javax.servlet.Filter interface destroy method that destroys the filter.
doFilter(ServletRequest, ServletResponse, FilterChain) - Method in class oracle.ord.im.OrdMultipartFilter
Deprecated.
Implements the javax.servlet.Filter interface doFilter method that handles the servlet request with multipart/form-data encoding.

E

enableParameterTranslation(String) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Enables the translation of all HTML form parameter names and all text-based HTML form parameter values using the specified character encoding when parsing the body of a multipart/form-data POST request.

G

getContentLength() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Returns the length of the uploaded media file.
getFileParameter(String) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Returns information about an uploaded file identified by parameter name, as an OrdHttpUploadFile object.
getFileParameter(String) - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Gets information about an uploaded file identified by the file's parameter name as an OrdHttpUploadFile object.
getFileParameterNames() - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Returns an Enumeration of the names of all the input fields of type file in an HTML form, or an empty Enumeration if there are no input fields of type file.
getFileParameterNames() - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Returns an Enumeration of the names of all the input fields of type file in an HTML form.
getFileParameterValues(String) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Returns an array of OrdHttpUploadFile objects that represents all files uploaded using the specified parameter name.
getFileParameterValues(String) - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Gets an array of OrdHttpUploadFile objects that represents all the files uploaded using the specified parameter name.
getInputStream() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Returns an InputStream object that can be used to read uploaded data directly.
getMimeType() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Returns the MIME type of the media file, as determined by the browser when the file is uploaded.
getOriginalFileName() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Returns the original file name, as provided by the browser.
getParameter(String) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Returns the value of the first query string parameter or text-based form field parameter with the specified name, or null if the parameter does not exist.
getParameter(String) - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Returns the value of the first query string parameter or text-based form field parameter with the specified name, or null if the parameter does not exist.
getParameterMap() - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Returns a java.util.Map of the query string parameters and text-based form field data parameters.
getParameterNames() - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Returns an Enumeration of all the query string parameter names and all the text-based form field parameter names in the request, or an empty Enumeration if there are no query string parameters and no text-based form field parameters.
getParameterNames() - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Returns an Enumeration of all the query string parameter names and all the text-based form field parameter names in the request, or an empty Enumeration if there are no query string parameters and no text-based form field parameters.
getParameterValues(String) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Returns an array of String objects containing the values of all the query string parameters and text-based form field data parameters with the specified parameter name, or null if the parameter does not exist.
getParameterValues(String) - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Returns an array of String objects containing the values of all the query string parameters and text-based form field data parameters with the specified parameter name, or null if the parameter does not exist.
getSimpleFileName() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Returns the simple file name, (that is, the name of the file and the extension).
getTempFile() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Exists as an internal method only.

I

init(FilterConfig) - Method in class oracle.ord.im.OrdMultipartFilter
Deprecated.
Implements the javax.servlet.Filter interface init method that initializes the filter.
isUploadRequest() - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Tests if the request was encoded using the multipart/form-data encoding format.

L

loadAudio(OrdAudio) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdAudio Java object and sets the properties based on the audio data.
loadAudio(OrdAudio, byte[][], boolean) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdAudio Java object and sets the properties using an application-supplied, format plug-in context.
loadBlob(BLOB) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded media file into a BLOB.
loadDoc(OrdDoc) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdDoc Java object and sets the properties based on the contents of the document.
loadDoc(OrdDoc, byte[][], boolean) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdDoc Java object and sets the properties using an application-supplied, format plug-in context.
loadImage(OrdImage) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdImage Java object and sets the properties based on the image data.
loadImage(OrdImage, String) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdImage Java object and sets the properties according to an application-supplied command string.
loadVideo(OrdVideo) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdVideo Java object and sets the properties based on the video data.
loadVideo(OrdVideo, byte[][], boolean) - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Loads the uploaded file into an OrdVideo Java object and sets the properties using an application-supplied, format plug-in context.

O

oracle.ord.im - package oracle.ord.im
 
OrdHttpJspResponseHandler - Class in oracle.ord.im
Deprecated.
The OrdHttpJspResponseHandler class facilitates the retrieval of media data from Oracle Database, and its delivery to a browser or other HTTP client from a JSP page.

This class inherits the DEFAULT_BUFFER_SIZE field from the OrdHttpResponseHandler class.

An Important Note on JSP Engines
  • JSP engines are not required to support access to the servlet binary output stream. Therefore, not all JSP engines support the delivery of media data using the OrdHttpJspResponseHandler class.
  • All media data stored internally in the database using the Oracle Multimedia types, including text documents stored using the OrdDoc type, is stored using a binary LOB data type. Media data stored in an operating system file outside the database is stored using a BFILE. Therefore, all media data is delivered to the browser through the servlet binary output stream, using the ServletOutputStream class.
  • All the send methods in the OrdHttpJspResponseHandler class mirror the initial processing of the jsp:forward tag. Specifically, these send methods call the JspWriter clear method to clear the output buffer of the page prior to obtaining the binary output stream. However, JSP engines are not required to support a call to the ServletResponse getOutputStream method from within a JSP page. A JSP engine that does not support this typically throws an IllegalStateException error from the getOutputStream method. However, the exact behavior is implementation-specific.
  • If your JSP engine does not support access to the binary output stream from within a JSP page, then you must use a servlet to deliver media data. For example, perform one of the following operations:
    • Use the jsp:forward tag to forward a media retrieval request to a servlet.
    • Construct media retrieval URLs to retrieve the data directly from a servlet.
An Important Note on Return Statements
  • When delivering media data from a JSP page, a return statement is always required following a call to any of the send methods of the OrdHttpJspResponseHandler class. The return statement is necessary to ensure that no other data is written to the output stream of the JSP page following the media data.
  • An if ( true ) { ... return; } construct can be used to avoid the statement not reachable error that may result from the presence of additional code, generated by the JSP engine, at the end of a compiled page. This construct, which mirrors exactly the code produced by some JSP engines to handle the <jsp:forward ... >; directive, is shown in the example provided later in this section.
Note
  • An Oracle Multimedia Java object, such as an OrdImage object, is not dependent on the JDBC statement or result set from which it was obtained. However, an Oracle Multimedia Java object is dependent on the JDBC connection it is using, and on which the SQL statement was executed or from which the result set was obtained. Therefore, having obtained an Oracle Multimedia Java object from the database, an application must not release the JDBC connection before delivering the media data to the browser.

All the send methods in this class all call the JspWriter clear method to clear the page's output buffer prior to delivering the media. Therefore, the page must use the buffered output model, which is the default.

The following example demonstrates how to use the OrdHttpJspResponseHandler class to retrieve an image from the database and deliver it to a browser. The return statement ensures that the trailing newline characters following the final end tag (represented by a percent mark and right-angle bracket, or %>) are not transmitted to the browser as part of the image.

The if ( true ) { ... return; } construct is used to avoid the statement not reachable error that would otherwise by produced by this example due to the additional statements, generated by the JSP engine, at the end of the compiled page.

  <%@ page language="java" %>
  <%@ page import="OrdSamplePhotoAlbumBean" %>
  <%@ page import="oracle.ord.im.OrdHttpJspResponseHandler" %>

  <jsp:useBean id="photos" scope="page"
               class="OrdSamplePhotoAlbumBean"/>
  <jsp:useBean id="handler" scope="page"
               class="oracle.ord.im.OrdHttpJspResponseHandler"/>

  <%
    //
    // Select the entry from the table using the ID request parameter,
    // then fetch the row.
    //
    photos.selectRowById(request.getParameter("id"));
    if (!photos.fetch())
    {
      response.setStatus(response.SC_NOT_FOUND);
      return;
    }

    //
    // Set the page context for the retrieve request, then retrieve
    // the image from the database and deliver it to the browser. The
    // getImage() method returns an object of type 
    // oracle.ord.im.OrdImage.
    //
    if (true)
    {
        handler.setPageContext(pageContext);
        handler.sendImage(photos.getImage());
        return;
    }
  %>

Prerequisites

In order to run Oracle Multimedia methods for servlets and JSP, you will need to import classes from the oracle.ord.im package into your Java file.

You may also need to import classes from the following Java packages:

 java.sql.
 java.io.
 javax.servlet.
 javax.servlet.http.
 oracle.jdbc.
 oracle.sql.

OrdHttpJspResponseHandler() - Constructor for class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Creates an OrdHttpJspResponseHandler object to handle the response to a media retrieval request.
OrdHttpJspResponseHandler(PageContext) - Constructor for class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Creates an OrdHttpJspResponseHandler object to handle the response to a media retrieval request, and specifies the PageContext object for the response handler.
OrdHttpResponseException - Exception in oracle.ord.im
Deprecated.
The OrdHttpResponseException class extends ServletException to report errors encountered during the retrieval and delivery of multimedia data from a database to an HTTP client.
OrdHttpResponseHandler - Class in oracle.ord.im
Deprecated.
The OrdHttpResponseHandler class facilitates the retrieval of media data from Oracle Database, and its delivery to a browser or other HTTP client from a Java servlet.

An Oracle Multimedia Java object, such as an OrdImage object, is not dependent on the JDBC statement or result set from which it was obtained. However, an Oracle Multimedia Java object is dependent on the JDBC connection it is using and on which the SQL statement was executed, or from which the result set was obtained. Therefore, having obtained an Oracle Multimedia Java object from the database, an application must not release the JDBC connection before delivering the media data to the browser.

This class contains the following field: public static final int DEFAULT_BUFFER_SIZE.

The OrdHttpResponseHandler class uses a default buffer size of 32768 to retrieve LOB data from the database and deliver it to the client. You can override this value with the setBufferSize method.

The following example shows how to use the OrdHttpResponseHandler class to retrieve an image from a database and deliver it to a browser:

  PreparedStatement stmt = conn.prepareStatement(
      "select photo from photo_album where id = ?" );
  stmt.setString( 1, request.getParameter( "photo_id" ) );
  OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
  if ( rset.next() )
  {
      OrdImage media = (OrdImage)rset.getORAData( 1, OrdImage.getORADataFactory() );
      OrdHttpResponseHandler handler =
          new OrdHttpResponseHandler( request, response );
      handler.sendImage(media);
  }
  else
  {
      response.setStatus( response.SC_NOT_FOUND );
  }
  rset.close();
  stmt.close();

A Note on the Use of Charsets Other Than ISO-8859-1 (Latin-1)
  • If you wish to retrieve from an OrdDoc object a text-based document with a character set (charset) other than ISO-8859-1 (also called Latin-1), and deliver that document to a browser, your application must specify the charset name in the HTTP Content-Type header.
  • If the charset specification is included in the MIME type attribute in the OrdDoc object, then your application needs to call only the sendDoc method to retrieve the document and deliver it to the browser. For example, an HTML page that is written in Japanese might be stored in the OrdDoc object with a MIME type of text/html; charset=Shift_JIS. In this case, calling sendDoc method will send the appropriate Content-Type header, allowing the browser to display the page correctly.
  • However, if the MIME type in the OrdDoc object does not include the charset specification, then you must call one of the sendResponse methods and specify the MIME type explicitly. For example, if the MIME type of an HTML page written in Japanese is stored in the OrdDoc object as text/html, and the charset name is specified in a separate column, then the application must append the charset specification to the MIME type before calling a sendResponse method. For example:
      OraclePreparedStatement stmt =
          (OraclePreparedStatement)conn.prepareStatement(
              "select doc, charset from documents where id = ?" );
      stmt.setString( 1, request.getParameter("id") );
      OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
      if ( rset.next() )
      {
          OrdDoc doc = (OrdDoc)rset.getORAData( 1, OrdDoc.getORADataFactory() );
          String charset = rset.getString( 2 );
          String mimeType = doc.getMimeType() + "; charset=" + charset;
          OrdHttpResponseHandler handler =
                          new OrdHttpResponseHandler( request, response );
          handler.sendResponse( mimeType, doc.getContentLength(),
                                doc.getContent(), doc.getUpdateTime() );
      }
      else
      {
          response.setStatus( response.SC_NOT_FOUND );
      }
      rset.close();
      stmt.close();
    
    
Prerequisites

In order to run Oracle Multimedia methods for servlets and JSP, you will need to import classes from the oracle.ord.im package into your Java file.

You may also need to import classes from the following Java packages:

 java.sql.
 java.io.
 javax.servlet.
 javax.servlet.http.
 oracle.jdbc.
 oracle.sql.

OrdHttpResponseHandler() - Constructor for class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Creates an OrdHttpResponseHandler object to handle the response to a media retrieval request.
OrdHttpResponseHandler(HttpServletRequest, HttpServletResponse) - Constructor for class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Creates an OrdHttpResponseHandler object to handle the response to a media retrieval request and specifies the HttpServletRequest and HttpServletResponse objects for the response handler.
OrdHttpUploadException - Exception in oracle.ord.im
Deprecated.
The OrdHttpUploadException class extends IOException to report errors encountered during the uploading of multimedia data from an HTTP client to a database. Its primary purpose is to allow the localization of error message text.
OrdHttpUploadFile - Class in oracle.ord.im
Deprecated.
The OrdHttpUploadFile class facilitates the handling of uploaded files by providing an API that applications can call to load media data into Oracle Database. Form-based file uploading using HTML forms encodes form data and uploaded files in POST requests using the multipart/form-data format. The OrdHttpUploadFile class is used to represent an uploaded file that has been parsed by the OrdHttpUploadFormData class.

The OrdHttpUploadFile class provides methods to obtain information about the uploaded file, to access the contents of the file directly, and to facilitate loading the contents into an Oracle Multimedia object in a database.

Every input field of type file in an HTML form will produce a parameter of type OrdHttpUploadFile, whether or not a user enters a valid file name into such a field. Depending on the requirements, applications can test the length of the file name, the length of the content, or both, to determine if a valid file name was entered by a user and if the file was successfully uploaded by the browser. For example, if a user does not enter a file name, the OrdHttpUploadFile.getOriginalFileName() method will return the file name whose length is zero. However, if a user enters either an invalid file name or the name of an empty (zero-length) file, the getOriginalFileName method will return the file name whose length is not zero, and the OrdHttpUploadFile.getContentLength() method will return the content length of the file as zero.

Prerequisites

In order to run Oracle Multimedia methods for servlets and JSP, you will need to import classes from the oracle.ord.im package into your Java file.

You may also need to import classes from the following Java packages:

 java.sql.
 java.io.
 javax.servlet.
 javax.servlet.http.
 oracle.jdbc.
 oracle.sql.

OrdHttpUploadFormData - Class in oracle.ord.im
Deprecated.
The OrdHttpUploadFormData class facilitates the processing of POST requests using the multipart/form-data format. Form-based file uploading using HTML forms encodes form data and uploaded files in POST requests using this format. The OrdHttpUploadFormData class parses the POST data and makes the contents of regular form fields and uploaded files readily accessible to a Java servlet or JSP page.

The OrdHttpUploadFormData class provides methods to access text-based form field parameters that are identical to the getParameter, getParameterValues, and getParameterNames methods provided by the ServletRequest class. Access to uploaded files is provided by a similar set of methods, namely OrdHttpUploadFormData.getFileParameter(java.lang.String), OrdHttpUploadFormData.getFileParameterValues(java.lang.String) and OrdHttpUploadFormData.getFileParameterNames(). The OrdHttpUploadFile objects returned by the getFileParameter and getFileParameterValues methods provide simple access to the MIME type, length, and contents of each uploaded file. For more information on OrdHttpUploadFile objects, see the OrdHttpUploadFile class.

The following is an example of how to use the OrdHttpUploadFormData class:

  //
  // Create an OrdHttpUploadFormData object and use it to parse the
  // multipart/form-data message.
  //
  OrdHttpUploadFormData formData = new OrdHttpUploadFormData( request );
  formData.parseFormData();

  //
  // Get the description, location, and photograph.
  //
  String id = formData.getParameter( "id" );
  String description = formData.getParameter( "description" );
  String location = formData.getParameter( "location" );
  OrdHttpUploadFile photo = formData.getFileParameter( "photo" );

  //
  // Prepare and execute a SQL statement to insert a new row into
  // the table and return the sequence number for the new row.
  // Disable auto-commit to allow the LOB to be written correctly.
  //
  conn.setAutoCommit( false );
  PreparedStatement stmt = conn.prepareStatement(
      "insert into photo_album (id, description, location, photo) " +
      "    values (?, ?, ?, ORDSYS.ORDIMAGE.INIT() )" );
  stmt.setString( 1, id );
  stmt.setString( 2, description );
  stmt.setString( 3, location );
  stmt.executeUpdate();

  //
  // Prepare and execute a SQL statement to fetch the new OrdImage
  // object from the database.
  //
  stmt = conn.prepareStatement(
              "select photo from photo_album where id = ? for update" );
  stmt.setString( 1, id );
  OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
  if ( !rset.next() )
  {
      throw new ServletException( "new row not found in table" );
  }
  OrdImage media = (OrdImage)rset.getORAData( 1, OrdImage.getORADataFactory());

  //
  // Load the photograph into the database and set the properties.
  //
  photo.loadImage(media);

  //
  // Prepare and execute a SQL statement to update the image object.
  //
  stmt = (OraclePreparedStatement)conn.prepareStatement(
                  "update photo_album set photo = ? where id = ?" );
  stmt.setORAData( 1, media );
  stmt.setString( 2 id );
  stmt.execute();
  stmt.close();

  //
  // Commit the changes.
  //
  conn.commit();

A Note on the Handling of Query String Parameters and Text-Based HTML Form Field Parameters
  • Every parameter in the optional query string of a request produces a corresponding parameter of type String, whether or not any data is associated with the parameter name. Likewise, every text-based input field in an HTML form also produces a corresponding parameter of type String, whether or not any data is entered into a field. When processing query string parameters and text-based input fields, applications can test the length of the corresponding String object to determine if any data is present.
  • The parseFormData method merges all query string and form field parameters into a single set of ordered parameters, where the query string parameters are processed first, followed by the form field parameters. Thus, query string parameters take precedence over form field parameters. For example, if a request is made with a query string of arg=hello&arg=world and the values greetings and everyone are entered into two HTML form fields named arg, then the resulting parameter set would include the following entry: arg=(hello, world, greetings, everyone).
Note on the Handling of FILE-Type HTML Form Field Parameters
  • Every input field of type file in an HTML form produces a corresponding parameter of type OrdHttpUploadFile, whether or not a valid file name is entered into the field. When processing a field of type FILE, applications can test either the length of the file name, the length of the content, or a combination of the two to determine if a valid file name was entered by a user, and if the file was successfully uploaded by the browser. See the OrdHttpUploadFile class for more information.
A Note on the Use of Non-Western European Languages
  • The Microsoft Internet Explorer browser allows data to be entered into an HTML form using a character set encoding that is different from that being used to view the form. For example, it is possible to copy Japanese Shift_JIS character set data from one browser window and paste it into a form being viewed using the Western European (ISO) character set in a different browser window. In this situation, Internet Explorer can sometimes transmit the form data twice in such a way that the multipart/form-data parser cannot detect the duplicated data. Furthermore, the non-Western European language form data is sometimes sent as a Unicode escape sequence, sometimes in its raw binary form, and sometimes duplicated using both formats in different portions of the POST data.
  • Although this same problem does not exist with the Netscape browser, care must still be taken to ensure that the correct character set is being used. For example, although it is possible to copy Japanese Shift_JIS character set data from one browser window and paste it into a form being viewed using the Western European (ISO) character set in a different browser window, when the data is pasted into the form field, the two bytes that comprise each Japanese Shift_JIS chacter are stored as two individual Western European (ISO) characters.
  • Therefore, care must be taken to view an HTML form using the correct character set, no matter which Web browser is used. For example, the HTML META tag can be used to specify the character set as follows:
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS ">
    
    
Prerequisites

In order to run interMedia methods for servlets and JSP, you will need to import classes from the oracle.ord.im package into your Java file.

You may also need to import classes from the following Java packages:

 java.sql.
 java.io.
 javax.servlet.
 javax.servlet.http.
 oracle.jdbc.
 oracle.sql.

OrdHttpUploadFormData() - Constructor for class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Creates an OrdHttpUploadFormData object to parse a multipart/form-data request.
OrdHttpUploadFormData(ServletRequest) - Constructor for class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Creates an OrdHttpUploadFormData object to parse a multipart/form-data request.
OrdMultipartFilter - Class in oracle.ord.im
Deprecated.
The OrdMultipartFilter class filters form-based, file-upload servlet requests whose contents are encoded in multipart/form-data format. This class wraps a request object with an OrdMultipartWrapper object that parses the request content.

The OrdMultipartFilter class implements the javax.servlet.Filter interface in servlet 2.3. For any servlet container that supports servlet 2.3, this filter combined with the OrdMultipartWrapper object, provides transparent access to the parameters and files in the servlet request with multipart/form-data encoding.

In order to use the OrdMultipartFilter class, you will need to specify the following in the web.xml file:

  <filter>
  <filter-name>OrdMultipartFilter</filter-name>
  <filter-class>oracle.ord.im.OrdMultipartFilter</filter-class>
  <!-- optional configuration parameters
  <init-param>
    <param-name>tempDir</param-name>
    <param-value>/tmp</param-value>
    <param-name>maxMemory</param-name>
    <param-value>5000</param-value>
  </init-param>
  -->
  </filter>
  <filter-mapping>
  <filter-name>OrdMultipartFilter</filter-name>
  <url-pattern>*.jsp</url-pattern>
  </filter-mapping>

And you will need to specify the following in the JSP file:

   //
    // Get the description, location, and photograph.
    //
    String id = request.getParameter( "id" );
    String description = request.getParameter( "description" );
    String location = request.getParameter( "location" );
    OrdHttpUploadFile photo = request.getFileParameter( "photo" );

    //
    // Prepare and execute a SQL statement to insert a new row into
    // the table and return the sequence number for the new row.
    // Disable auto-commit to allow the LOB to be written correctly.
    //
    conn.setAutoCommit( false );
    PreparedStatement stmt = conn.prepareStatement(
        "insert into photo_album (id, description, location, photo) " 
        "    values (?, ?, ?, ORDSYS.ORDIMAGE.INIT() )" );
    stmt.setString( 1, id );
    stmt.setString( 2, description );
    stmt.setString( 3, location );
    stmt.executeUpdate();

    //
    // Prepare and execute a SQL statement to fetch the new OrdImage
    // object from the database.
    //
    stmt = conn.prepareStatement(
                "select photo from photo_album where id = ? for update" );
    stmt.setString( 1, id );
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    if ( !rset.next() )
    {
        throw new ServletException( "new row not found in table" );
    }
    OrdImage media = (OrdImage)rset.getORAData( 1, OrdImage.getORADataFactory());

    //
    // Load the photograph into the database and set the properties.
    //
    photo.loadImage(media);

    //
    // Prepare and execute a SQL statement to update the image object.
    //
    stmt = (OraclePreparedStatement)conn.prepareStatement(
                    "update photo_album set photo = ? where id = ?" );
    stmt.setORAData( 1, media );
    stmt.setString( 2 id );
    stmt.execute();
    stmt.close();

    //
    // Commit the changes.
    //
    conn.commit();

Prerequisites

In order to run Oracle Multimedia methods for servlets and JSP, you will need to import classes from the oracle.ord.im package into your Java file.

You may also need to import classes from the following Java packages:

 java.sql.
 java.io.
 javax.servlet.
 javax.servlet.http.
 oracle.jdbc.
 oracle.sql.

OrdMultipartFilter() - Constructor for class oracle.ord.im.OrdMultipartFilter
Deprecated.
 
OrdMultipartWrapper - Class in oracle.ord.im
Deprecated.
The OrdMultipartWrapper class wraps the HttpServletRequest object and provides access to the contents in the HTTP request that are encoded using multipart/form-data encoding. This class overrides some of the methods in the HttpServletRequestWrapper class to provide access to the text-based form field parameters. This class also defines new methods to provide access to the uploaded files.
Prerequisites

In order to run Oracle Multimedia methods for servlets and JSP, you will need to import classes from the oracle.ord.im package into your Java file.

You may also need to import classes from the following Java packages:

 java.sql.
 java.io.
 javax.servlet.
 javax.servlet.http.
 oracle.jdbc.
 oracle.sql.

OrdMultipartWrapper(HttpServletRequest, int, String) - Constructor for class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Creates an OrdMultipartWrapper object that wraps the HttpServletRequest object with multipart/form-data content.

P

parseFormData() - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Parses the body of a POST request encoded using the multipart/form-data encoding.

R

release() - Method in class oracle.ord.im.OrdHttpUploadFile
Deprecated.
Releases all resources held by an OrdHttpUploadFile object.
release() - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Releases all resources held by an OrdHttpUploadFormData object, including temporary files used to hold the contents of uploaded files.
release() - Method in class oracle.ord.im.OrdMultipartWrapper
Deprecated.
Releases the resources owned by an OrdMultipartWrapper object.

S

sendAudio(OrdAudio) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Retrieves an audio clip from an OrdAudio object and delivers it to the browser.
sendAudio(OrdAudio) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves an audio clip from an OrdAudio object and delivers it to the browser.
sendDoc(OrdDoc) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Retrieves media data from an OrdDoc object and delivers it to the browser.
sendDoc(OrdDoc) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves media data from an OrdDoc object and delivers it to the browser.
sendImage(OrdImage) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Retrieves an image from an OrdImage object and delivers it to the browser.
sendImage(OrdImage) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves an image from an OrdImage object and delivers it to the browser.
sendResponse(String, int, BLOB, Timestamp) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Builds the HTTP response header, then retrieves the contents of the BLOB from the database and delivers it to the browser.
sendResponse(String, int, BFILE, Timestamp) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Builds the HTTP response header, then retrieves the contents of the BFILE from the database and delivers it to the browser.
sendResponse(String, int, InputStream, Timestamp) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Builds the HTTP response header, then retrieves the contents of the InputStream object and delivers it to the browser.
sendResponse() - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Builds an HTTP response header, then retrieves the contents of the media data from the database and delivers it to the browser.
sendResponse(String, int, BLOB, Timestamp) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Builds the HTTP response header, then retrieves the contents of the BLOB from the database and delivers it to the browser.
sendResponse(String, int, BFILE, Timestamp) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Builds the HTTP response header, then retrieves the contents of the BFILE from the database and delivers it to the browser.
sendResponse(String, int, InputStream, Timestamp) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Builds the HTTP response header, then retrieves the contents of the InputStream object and delivers it to the browser.
sendResponse() - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves a media object from one of the Oracle Multimedia objects (OrdImage, OrdAudio, OrdVideo, or OrdDoc) and delivers it to the browser.
sendResponseBody(int, BLOB) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves the content of a BLOB from the database and delivers it as the response body to the browser.
sendResponseBody(int, BFILE) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves the content of a BFILE from the database and delivers it as the response body to the browser.
sendResponseBody(int, InputStream) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves the content of the InputStream object and delivers it as the response body to the browser.
sendVideo(OrdVideo) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Retrieves a video clip from an OrdVideo object and delivers it to browser.
sendVideo(OrdVideo) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Retrieves a video clip from an OrdVideo object and delivers it to the browser.
setBufferSize(int) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the buffer size for LOB read and HTTP response write operations.
setEncodeHtml(boolean) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Enables the encoding of special characters (! " % & ' ( ) ; < >) from the response output stream with HTML numeric code.
setHeader(String, String) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the HTTP response header with the String value.
setHeader(String, long) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the HTTP response header with the date value.
setHeader(String, int) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the HTTP response header with the integer (int) value.
setMaxMemory(int, String) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Specifies the maximum amount of memory that the contents of uploaded files can consume before the contents are stored in a temporary directory.
setMedia(OrdImage) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the OrdImage object as the media object to be delivered.
setMedia(OrdAudio) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the OrdAudio object as the media object to be delivered.
setMedia(OrdVideo) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the OrdVideo object as the media object to be delivered.
setMedia(OrdDoc) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Sets the OrdDoc object as the media object to be delivered.
setPageContext(PageContext) - Method in class oracle.ord.im.OrdHttpJspResponseHandler
Deprecated.
Specifies the PageContext object for this response handler.
setServletRequest(HttpServletRequest) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Specifies the HttpServletRequest object for this response handler.
setServletRequest(ServletRequest) - Method in class oracle.ord.im.OrdHttpUploadFormData
Deprecated.
Specifies the ServletRequest object for the request.
setServletResponse(HttpServletResponse) - Method in class oracle.ord.im.OrdHttpResponseHandler
Deprecated.
Specifies the HttpServletResponse object for this response handler.
D E G I L O P R S 
Skip navigation links
Oracle® Multimedia Servlets and JSP Java API Reference
12c Release 2 (12.2)

E86002-01

Copyright © 1999, 2017, Oracle and/or its affiliates. All rights reserved.