WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.jdbc.oracle
Class exsql

java.lang.Object
  |
  +--examples.jdbc.oracle.exsql

public class exsql
extends java.lang.Object

This simple example shows how JDBC Extended SQL can be embedded in standard SQL sent to the DBMS. Extended SQL is part of the JDBC spec, and provides a DBMS-neutral way of using the many secondary functions that all DBMSes provide, but in a proprietary syntax. The WebLogic JDBC drivers will convert extended SQL syntax to the DBMS-specific syntax for the relevant function. Please see our documentation for links to the complete Extended SQL specification.

This example is run on the command line and is output to System.out.

Build the Example

  1. Open a new command shell.

  2. Set up this development shell as described in Setting up Your Environment for Building and Running the Examples.

  3. Change connection parameters to correspond to your Oracle configuration. If you need more help, check the section on connecting to a database in the programming guide, Using WebLogic jDriver for Oracle.

  4. Compile the example by executing the following command or by executing the build script provided for this example in the samples/examples/jdbc/oracle directory. The script will perform the following step:

Run the Example

There's More

For more information about the WebLogic jDriver for Oracle, see Installing and Using WebLogic jDriver for Oracle.

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

Constructor Summary
exsql()
           
 
Method Summary
static void main(java.lang.String[] argv)
          In the main, we set properties for the connection, acquire a Connection object, and then create the Extended SQL and execute it in the Statement.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

exsql

public exsql()
Method Detail

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
In the main, we set properties for the connection, acquire a Connection object, and then create the Extended SQL and execute it in the Statement. The Extended SQL we use here is an example of SQL that includes a few Extended SQL escapes. Note that an Extended SQL element is enclosed by {}. This example uses the function dayname, the function now(), and a date, time, and timestamp escape. Note that Extended SQL escapes can be nested.

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

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