WebLogic Server 6.1 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 an ant build script or a command.

  • 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:

      • Click to expand the JDBC node in the left-hand pane.
      • Click to expand the Connection Pool node, then verify that demoPool appears under Connection Pool.
      • Click to expand the Data Source node, then verify that examples-dataSource-demoPool shows demoPool as the pool name in the right-hand pane.

    Run the Example

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

    There's more

    Author:
    Copyright (c) 2000-2001 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/docs61

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