    All Examples This Package

# Class examples.dbkona.query

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

public class query
extends Object

This simple example shows how to connect and execute queries with dbKona. You will need to have Oracle running the DEMO database, with WebLogic jDriver for Oracle (or another Oracle JDBC driver). This example is executed 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/htmlkona and examples/servlets folders.

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:

1. Set up your development shell as described in Setting up your environment.

2. 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.

3. Compile this example by executing the following command in your development shell:

   $ javac -d %CLIENT_CLASSES% query.java

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

   $ java examples.dbkona.query

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

##

query()

##

main(String[])
  Here the JDBC connection is set up and created.

##

query

     public query()

##

main

     public static void main(String argv[]) throws Exception

  Here the JDBC connection is set up and created. A JDBC Statement is executed, and its resulting data is used to construct a dbKona QueryDataSet from the "emp" table in the Oracle DEMO database.

  A QueryDataSet simplifies the client-side management of JDBC results by providing the infrastructure of a memory cache. QueryDataSets also allow records to be fetched incrementally. dbKona also provides methods associated with DataSets to automatically generate SQL. A QueryDataSet can be constructed with or without a JDBC ResultSet, which is shown in this method.

  After working with the DataSet, we close it, as well as the JDBC ResultSet and the Statement used to execute the query.

    All Examples This Package