|
| WebLogic Server 6.0 Code Examples, BEA Systems, Inc. |
SUMMARY: INNER | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD |
examples.dbkona
Class records
java.lang.Object
|
+--examples.dbkona.records
- public class records
- extends java.lang.Object
This example constructs a dbKona TableDataSet for inserting, updating,
and deleting records from an Oracle database. To run this example,
you must have the Oracle DEMO database running. The connection to
the database is made with WebLogic jDriver for Oracle. This example is run
from the command line and results are displayed to standard
out.
For other examples of how to display query results, check the
server-side Java examples that use htmlKona and dbKona in the
examples/servlets directories.
If you don't have the Oracle DEMO database, you can
use the file utils/ddl/demo.ddl to set it up.
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 records class as shown in this example for Windows NT/2000:
$ javac -d %CLIENT_CLASSES% records.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.records
- Author:
- Copyright (c) 1996-2000 by BEA Systems, Inc. All Rights Reserved.
Method Summary |
static void |
main(java.lang.String[] argv)
First the JDBC connection is set up and created. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
records
public records()
main
public static void main(java.lang.String[] argv)
- First the JDBC connection is set up and created. Using
the JDBC connection object, a TableDataSet is constructed
without using SQL -- by supplying the Connection object
and the name of the Oracle table. In this example, there
is code for inserting, updating, and deleting records
with SQL that is automatically generated.
Creating a TableDataSet with a KeyDef is also illustrated
in this sample code, which is required for
updates and deletes to the DBMS data. You can save
at either the record level or the table level with
dbKona.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.