All Examples This Package
Class examples.dbkona.rowid
java.lang.Object
|
+----examples.dbkona.rowid
- public class rowid
- extends Object
This example constructs a TableDataSet for inserting, updating,
and deleting records from an Oracle database. It illustrates
the use of an Oracle ROWID as a unique key for updates and deletes.
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 the
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 examples/applets/emp.sql to set it up.
To set up this example:
- Set up your development shell as described in
Setting up your environment.
- Change connection parameters to correspond to your Oracle configuration.
If you need more help, check the section on connecting
to a database in the Developers Guide, Using WebLogic jDriver for Oracle.
- Compile this example by executing the following command in your development shell:
$ javac -d %CLIENT_CLASSES% rowid.java
- Run this example by executing the following command in your development shell:
$ java examples.dbkona.rowid
- Author:
- Copyright (c) 1996-2000 by BEA Systems, Inc. All Rights Reserved.
-
rowid()
-
-
main(String[])
- First the JDBC connection is configured and made.
rowid
public rowid()
main
public static void main(String argv[]) throws Exception
- First the JDBC connection is configured and made.
Then a dbKona TableDataSet is constructed using the JDBC
connection object and the name of the table. This example
illustrates how to add new records and save them selectively.
Then a KeyDef object (a unique attribute identifier) is
created for updates and deletes; the records that were
previously added are first updated, and then deleted to
illustrate code for these two tasks. A final call to the
save() method updates the DBMS with the changes made.
The last few lines of code close all the data objects that
were used in this example.
All Examples This Package