/*

 * @author  Sujatha
 * @version 1.0
 *
 *  Development Environment        :  Oracle9i JDeveloper
 *  Name of the Application        :  HttpCallout.java
 *  Creation/Modification History  :

 *
 *     Sujatha      01-Jul-2002      Created
 */

// Packages for http client library
import HTTPClient.HTTPResponse;
import HTTPClient.HTTPConnection;


/**
 *  This java stored procedure is attached as trigger to product_information 
 * table.  Any changes to the product_information table results in invokation of
 * this stored procedure which in turn call a JSP to invalidate the web object
 * cache that caches the product information
 */
public class HttpCallout {


  /** 
   * This method establishes a http connection with the specified url
   */
  public static void getURL( String hostname, String portnum, String url ) throws InterruptedException{
    try {

      // Process arguments
      String protocol = "http";

      String host     = hostname;
      int port        = Integer.parseInt(portnum);
      String page     = url;

      // Grab HTTPConnection
      HTTPConnection con = new HTTPConnection( protocol, host,  port);
      con.setTimeout(20000);
      con.setAllowUserInteraction(false);
      // Issue Get call
      HTTPResponse rsp = con.Get(page);

      // Terminate the connection
      con.stop();
    } catch( Throwable ex ) {
      ex.printStackTrace();
    }  
  }
}
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy