|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--examples.jdbc.mssqlserver4.ThreadsTests
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.
Note: You may need sa privileges in SQL Server to run this example. When you specify a user and password, make sure the user has sa privileges in the database.
If you need more help, check the section on connecting to a database in the programming guide, Using WebLogic jDriver for Microsoft SQL Server.
prompt> set CLASSPATH=%WL_HOME%/server/lib/mssqlserver4v65.jar;%CLASSPATH%
prompt> ant
Note: This script builds all of the examples in the mssqlserver4 directory.
prompt> ant run
Note: This script runs all of the examples in the mssqlserver4 directory.
*
| Field Summary | |
(package private) static java.lang.String |
driverName
|
(package private) static int |
kNumberOfConnections
|
(package private) static int |
kTestSeconds
|
(package private) static int |
kThreadsPerConnection
|
(package private) static int |
totalRows
|
(package private) static int |
totalRuns
|
| Constructor Summary | |
ThreadsTests()
|
|
| Method Summary | |
static void |
main(java.lang.String[] argv)
|
(package private) static void |
updateStatistics(int runs,
int rows)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static java.lang.String driverName
static int kNumberOfConnections
static int kTestSeconds
static int kThreadsPerConnection
static int totalRows
static int totalRuns
| Constructor Detail |
public ThreadsTests()
| Method Detail |
public static void main(java.lang.String[] argv)
static void updateStatistics(int runs,
int rows)
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||