All Examples This Package 
  Class examples.event.clockquery.QueryOnTime
java.lang.Object
   |
   +----examples.event.clockquery.QueryOnTime
  -  public class QueryOnTime
  -  extends Object
  -  implements ActionDef
This example shows a time-triggered
 action that  periodically makes a query to a DBMS and
 stores the current results in a WebLogic Server Workspace for common
 access to a set of clients. It works with the Register
 class in this directory.
 This example is set up for use with a Cloudscape database. Your
 database may require different parameters in the
 ParamSet passed to the registerInit() method. Check
 the Developers Guide for your WebLogic jDriver JDBC driver for
 information about required environment variables
 and parameters for connecting.
  -  Author:
  
-  Copyright (c) 1997-98 by WebLogic, Inc. All Rights Reserved.
  -  Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
   
  -   QueryOnTime() QueryOnTime()
-  
   
  -   action(EventMessageDef) action(EventMessageDef)
-   The action method contains the actual work for this
 class.
  
-   registerInit(ParamSet) registerInit(ParamSet)
-   Registers initialization parameters for the
 event message.
  
-   setServices(T3ServicesDef) setServices(T3ServicesDef)
-   Sets the access to services within the WebLogic 
 Server for a client.
   
 QueryOnTime
QueryOnTime
 public QueryOnTime()
   
 setServices
setServices
 public void setServices(T3ServicesDef services)
  -  Sets the access to services within the WebLogic 
 Server for a client.
   
- 
    -  Parameters:
    
-  services - T3ServicesDef object
  
 
 registerInit
registerInit
 public void registerInit(ParamSet params)
  -  Registers initialization parameters for the
 event message. The parameters of interest
 are the username, password, and servername
 for connecting to the DBMS.
   
- 
    -  Parameters:
    
-  params - ParamSet object
  
 
 action
action
 public void action(EventMessageDef ev)
  -  The action method contains the actual work for this
 class. In this method, we set up a java.util.Properties
 object and create a JDBC Connection with the appropriate
 JDBC driver and the Properties object. Then we execute
 an SQL statement and create a QueryDataSet with the
 results. We create a ParamSet and add the QueryDataSet
 to it with the key "dataset," and then we store the
 QueryDataSet in the server workspace, which gives access
 to all clients with workspaces within that server.
 
 This action method is called each time an event that
 evaluates to true is received by an interested
 registration. When you register an interest in this
 topic with the Register class also in this directory,
 this action is called according to a regular time
 schedule.
 
   
- 
    -  Parameters:
    
-  ev - EventMessage
  
 
All Examples  This Package