1. Database Connection
This document uses the SQL Server database as an example to describe how to access the database through ConnectionPool And DataSource.
1. Install the driver provided by Microsoft
Install JDBC For SQL Server Driver from Microsoft website http://www.microsoft.com/downloads/details.aspx? Install the driver. Modify the Classpath of WebLogic 7 and add
% SQLServer_JDBC % libmsbase. jar;
% SQLServer_JDBC % libmssqlserver. jar;
% SQLServer_JDBC % libmsutil. jar
, Restart WebLogic
2. Configure WebLogic.
Procedure:
To use ConnectionPool with DataSource, follow these steps:
1) create a connection pool (ConnectionPool ).
A. Select Services/JDBC/Connection Pools from the Console menu.
B. Click Configure a new JDBC Connection Pool...
C. Fill in the Configuration/General tab (the parameters vary depending on the JDBC driver)
Method 1: Use the Microsoft JDBC For SQL Server Driver:
Name: SQLServerPool
URL: jdbc: microsoft: sqlserver: // localhost: 1433; DatabaseName = master
Driver Classname: com. microsoft. jdbc. sqlserver. SQLServerDriver
Properties (key = value): user = sa
Password = sa
Method 1: Use the bea jdbc For SQL Server Driver (Chinese problems exist)
Name: SQLServerPool
URL: jdbc: microsoft: sqlserver: // localhost: 1433; DatabaseName = master
Driver Classname: com. microsoft. jdbc. sqlserver. SQLServerDriver
Properties (key = value): user = sa
Password = sa
D. Click Create.
E. Configuration/Connections Tab:
Initial Capacity: 1
Maximum Capacity: 5
Other Default values
F. Click Apply.
G. Targets/Servers Tab:
Select myserver and click Apply! If no error is reported, the connection pool is successfully created!
2) map the connection pool to a data source ).