WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.jdbc.mssqlserver4
Class exsql

java.lang.Object
  |
  +--examples.jdbc.mssqlserver4.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 provided by any DBMS, 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.

Please note that this example uses a simple method for obtaining result sets, update counts, and/or the output parameter values it may generate. This is always possible with simple, known queries. When executing complex or unknown possibly multi-statement SQL or stored procedures, you should use the example in complexproc.java to ensure that all results become available.

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 your CLASSPATH if neccessary, depending on which version of WebLogic jDriver for Microsoft SQL Server you are using. If you are using Version 7.0 you do not need to make changes. If you are using Version 6.5, pre-pend your classpath as follows by adding the jar file:
      $ set CLASSPATH=%WL_HOME%/lib/mssqlserver4v65.jar;%CLASSPATH%

  4. Change the database URL, login, and password connection parameters defined in the example source code to correspond to your Microsoft SQL Server configuration. If you need more help, check the section on connecting to a database in the programming guide, Using WebLogic jDriver for Microsoft SQL Server.

  5. Compile this example using the following command line:
      $ javac -d %CLIENT_CLASSES% exsql.java

Run the Example

  1. Execute the following command in your development shell:
    $ java examples.jdbc.mssqlserver4.exsql

There's More

For more information about the WebLogic jDriver for Microsoft SQL Server, see Using WebLogic jDriver for Microsoft SQL Server.

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

Constructor Summary
exsql()
           
 
Method Summary
static void main(java.lang.String[] argv)
           
 
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)

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

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