|
| WebLogic Server 6.0 Code Examples, BEA Systems, Inc. |
SUMMARY: INNER | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD |
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:
- Build the example
- Configure the server
- Run the example
- Set up your development shell as described in Setting up your environment for building and running the examples.
- Compile the example by executing the following command or by executing the build script
provided for this example in the samples/examples/dbkona
directory. The script will perform the following step:
- Compile the sequences class as shown in this example for Windows NT/2000:
$ javac -d %CLIENT_CLASSES% sequences.java
- Start the server with the examples configuration.
- Bring up the Administration
Console in your browser with the URL:
http://hostname:port/console
where:
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
- Click to expand the Services node in the left-hand pane.
- Click to expand the JDBC node in the left-hand pane.
- Click to expand the Connection Pools node in the left-hand pane.
- Select the oraclePool node.
- Select the Targets tab in the right-hand pane to display the Available and Chosen targets.
- Select the examplesServer target in the Available column.
- Click the mover control to move the examplesServer target to the Chosen column.
- Click the Apply button in the lower right-hand corner to save your assignment in the console configuration file.
Run the example
- Run this example by executing the following command in your development shell:
$ java examples.dbkona.sequences
- Author:
- Copyright (c) 1996-2000 by BEA Systems, Inc. All Rights Reserved.
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 |
sequences
public sequences()
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.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.