All Examples This Package
The classes in this directory work together to demonstrate a time-triggered action that periodically makes a query to a DBMS and stores the current results in a WebLogic Workspace for shared access among multiple Clients.
The Register class sets up a registration of interest in a particular database. Its registration uses the QueryOnTime class in this directory as its Action class and the weblogic.event.evaluators.EvaluateTime class as its Evaluator class. The registration is interested in a by-the-second timer event, and its action is to insert a new dated row into a table that it creates in a database called "tempdb." After each database change, the action method also refetches the affected table into a dbKona DataSet that is stored in WebLogic's server-level Workspace, where it is available to multiple clients.
This example has been set up for use with a Cloudscape database. You can use another database; just change the database-specific properties in both classes before compiling. If you need help on setting up a JDBC connection to a database, check out the Developers Guide for your JDBC driver. A list of WebLogic JDBC resources is available at WebLogic JDBC Options. Make sure to test your connection to the database before you try to use this example.
Once you've made any adjustments to the code, follow these steps:
$ javac -d %CLIENT_CLASSES% Register.java
$ javac -d %SERVER_CLASSES% QueryOnTime.java
$ java examples.event.clockquery.Register WebLogicURLwhere WebLogicURL is the URL of the WebLogic Server. The example contains additional user, password, and server parameters, which are not used with Cloudscape. If you convert the example to work with another DBMS, you can include these arguments on the command line.