WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.jdbc.datasource
Class simplesql

java.lang.Object
  |
  +--examples.jdbc.datasource.simplesql

public class simplesql
extends java.lang.Object

This example demonstrates obtaining a database connection using a DataSource object.

You use the Administration Console as well as the command line to build, compile, and run this example.

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. Compile the example by executing the following command or by executing the build script provided for this example in the samples/examples/jdbc/datasource directory. The script will perform the following step:

    1. Compile the simplesql class as shown in this example for Windows NT/2000:

      $ javac -d %CLIENT_CLASSES% simplesql.java

  4. Start WebLogic Server with the examples configuration.

Configure the Example

  1. Open the Administration Console.

  2. Verify that the Examples Web Application has been deployed on your server.

  3. Verify that the demo datasource, examples-dataSource-demoPool, points to the demoPool connection pool and that the demoPool is enabled, as follows:

Run the Example

  1. Execute the following command in your development shell:
    $ java examples.jdbc.datasource.simplesql

There's more

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

Constructor Summary
simplesql()
           
 
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

simplesql

public simplesql()
Method Detail

main

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

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

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