All Examples  This Package

Class examples.jdbc.mssqlserver4.ThreadsTests

java.lang.Object
   |
   +----examples.jdbc.mssqlserver4.ThreadsTests

public class ThreadsTests
extends Object
This example creates n database connections and runs n threads on each. You need valid licenses for the number of connections you want to try. The trial version provides 2 connections only. Contact support@weblogic.com for more connection licenses. Your SQL Server must also be configured to accept the number of connections you want to create.

The threads run for a designated number of seconds, executing a SQL SELECT statement. You can modify the number of seconds and the SQL command in the code.

To set up this example:

  1. Set up your development shell as described in Package examples.jdbc.mssqlserver4.

  2. Change the database URL, login, and password connection parameters to correspond to your Microsoft SQL Server configuration. If you need more help, check the section on connecting to a database in the Developers Guide, Using WebLogic jDriver for Microsoft SQL Server.

  3. Change the SQL Select statement to use an existing table on your SQL Server.

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

    $ javac -d c:/weblogic/mssqlserver4/classes ThreadsTests.java

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

    $ java examples.jdbc.mssqlserver4.ThreadsTests


Constructor Index

 o ThreadsTests()

Method Index

 o main(String[])

Constructors

 o ThreadsTests
 public ThreadsTests()

Methods

 o main
 public static void main(String args[])

All Examples  This Package