WebLogic Server Command Reference
CREATE_POOL
Creates a connection pool on the WebLogic Server instance running at the specified URL. For more information, see Creating a Connection Pool Dynamically in Programming WebLogic JDBC.
Syntax
java [ SSL Arguments ] weblogic.Admin
[ Connection Arguments ]
[ User Credentials Arguments ]
CREATE_POOL poolName props=myProps
,initialCapacity=1
,maxCapacity=1
,
capacityIncrement=1
,allowShrinking=true
,shrinkPeriodMins=15
,
driver=myDriver
,url=myURL
, testConnsOnReserve=true
,
testTableName=tablename,
testFrequencySeconds=0
Argument
|
Definition
|
poolName
|
Required. A unique name of the connection pool. Must be unique in the domain.
|
aclName
|
(Deprecated) Identifies the different access lists within fileRealm.properties in the server configuration directory. Paired name must be dynaPool.
|
props
|
Required. Database connection properties; typically in the format "database login name; server network id". Required entries vary by DBMS. Separate property value pairs with a semicolon.
|
password
|
Optional. Database login password. This value overrides any database password specified in props.
|
initialCapacity
|
Optional. Initial number of connections in a pool. If this property is defined, WebLogic Server creates these connections at boot time. Default is 1; cannot exceed maxCapacity.
|
maxCapacity
|
Optional. Maximum number of connections allowed in the pool. Default is 1; if defined, maxCapacity should be =>1.
|
capacityIncrement
|
Optional. Number of connections to add at a time when the connection pool is expanded. Default = 1.
|
allowShrinking
|
Optional. Indicates whether or not the pool can shrink when connections are detected to not be in use. Default = true.
|
shrinkPeriodMins
|
Optional. Interval between shrinking. Units in minutes. Minimum = 1.If allowShrinking = True , then default = 15 minutes.
|
driver
|
Required. Fully qualified driver classname of the JDBC driver.
|
url
|
Required. URL of the database as required by the JDBC driver. Format varies by DBMS.
|
testConnsOnReserve
|
Optional. Indicates reserved test connections. Default = False.
|
testConnsOnRelease
|
Optional. Indicates test connections when they are released. Default = False.
|
testTableName
|
Optional. Database table used when testing connections; must be present for tests to succeed. Required if either testConnsOnReserve or testConnsOnRelease are defined. Can also be a SQL query instead of a database table name. To use a SQL query, enter SQL followed by a space and the SQL query to run in place of the standard test.
|
refreshPeriod
|
Optional. Sets the connection refresh interval in minutes. Every unused connection will be tested using testTableName. Connections that do not pass the test will be closed and reopened in an attempt to reestablish a valid physical database connection. If TestTableName is not set then the test will not be performed.
|
loginDelaySecs
|
Optional. The number of seconds to delay before creating each physical database connection. This delay takes place both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created. Some database servers cannot handle multiple requests for connections in rapid succession. This property allows you to build in a small delay to let the database server catch up. This delay takes place both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created.
|
testFrequencySeconds
|
Optional. The number of seconds between database connection tests. After every interval specified by this value, unused database connections are tested using testTableName. Connections that do not pass the test are closed and reopened to re-establish a valid physical database connection.
Note: You cannot test the database connection if testTableName is not set.
When testFrequencySeconds is set to 0 (default value), periodic database testing is disabled.
|
Example
The following example creates a connection pool named demoPool on the MedRecManagedServer instance running on the host machine named ManagedHost and listening at port 7001 (when entered on a single command line):
java weblogic.Admin -url t3://ManagedHost:7001 -username weblogic
-password weblogic
CREATE_POOL demoPool
url=jdbc:pointbase:server://localhost:9092/demo,
driver=com.pointbase.jdbc.jdbcUniversalDriver,
testConnsOnReserve=true,
testTableName=SYSTABLES,
initialCapacity=2,
maxCapacity=10,
capacityIncrement=2,
allowShrinking=true,
props=user=examples;password=examples
If the command succeeds, it returns output similar to the following:
Connection pool "demoPool" created successfully.
After creating a JDBC connection pool, you can create a data source or a transactional data source that applications can use to access the JDBC connection pool.
The following commands create a transactional data source named demoDS on the MedRecManagedServer instance:
java weblogic.Admin -url t3://ManagedHost:7001 -username weblogic -password weblogic CREATE -mBean "medrec:Type=JDBCTxDataSource,Name=demoDS"
java weblogic.Admin -url t3://ManagedHost:7001 -username weblogic -password weblogic SET -mBean "medrec:Name=demoDS,Type=JDBCTxDataSource" -property "JNDIName" "demoDS" -property "PoolName" "demoPool"