WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.dbkona
Class sequences

java.lang.Object
  |
  +--examples.dbkona.sequences

public class sequences
extends java.lang.Object

This class demonstrates using a dbKona Sequence object to create, use, and drop an Oracle sequence. A dbKona Sequence object is a wrapper for an Oracle sequence.

To run this example, you'll need an Oracle database. The example is executed from the command line and results are displayed to standard out.

The following section describes how to build and run the examples:

  1. Build the example
  2. Configure the server
  3. Run the example

Build the example

  1. Set up your development shell as described in Setting up your environment for building and running the examples.

  2. Set your PATH to include the path to the WebLogic jDriver for Oracle DLLs. For example:
    set PATH=%PATH%;C:\bea\weblogic700\server\bin\oci817_8

  3. Set your CLASSPATH to include the path the BEA_HOME folder where the license.bea file resides. For example:
    set CLASSPATH=%CLASSPATH%;C:\bea

  4. Open sequences.java for editing and find the following code block:
           Properties props = new Properties();
           props.put("user",     "scott");
           props.put("password", "tiger");
           props.put("server",   "DEMO");
     
    You may need to replace these values to fit your configuration.

  5. Compile the example by executing an ant build script or a command.

Run the example

  1. Run this example by executing the following command in your development shell:

    prompt> ant run_sequences

Author:
Copyright (c) 1996-2002 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
sequences()
           
 
Method Summary
static void main(java.lang.String[] argv)
          Here the JDBC connection is configured and made.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

sequences

public sequences()
Method Detail

main

public static void main(java.lang.String[] argv)
Here the JDBC connection is configured and made. Before we attempt to create a new dbKona Sequence, which is always used in context of the JDBC connection object, we first try to drop a Sequence of the same name. Then the Sequence is created and its next value is printed out in a loop from 0 - 9. Finally the Sequence is dropped and closed, and the JDBC connection is closed.

Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.