Create Data Sources – SQL Server

SQL Server driver is not available by default while configuring a datasource on WebLogic. Hence we need to follow the below steps.

Update

Place the sqljdbc4.jar at $DOMAIN_HOME/lib (e.g. /scratch/oipa/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/lib/ )

Download Ref: https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4/4.0

Registering Driver Class and Description

Add the following code snippet at the mentioned file.

This snippet contains a description of Driver Class and the proper use of it inside Oracle Weblogic Driver declaration.

$WL_HOME/server/lib/jdbcdrivers.xml (e.g. /scratch/oipa/Oracle/Middleware/Oracle_Home/wlserver/server/lib/jdbcdrivers.xml)

/scratch/oipa/Oracle/Middleware/Oracle_Home/wlserver/server/lib/jdbcdrivers.xml

 
<Driver
Database="MS SQL Server"
Vendor="Microsoft"
Type="Type 4"
DatabaseVersion="2005 and later"
ForXA="false"
ClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
URLHelperClassname="weblogic.jdbc.utils.MSSQL2005JDBC4DriverURLHelper"
TestSql="SELECT 1">
<Attribute Name="DbmsName" Required="true" InURL="true"/>
<Attribute Name="DbmsHost" Required="true" InURL="true"/>
<Attribute Name="DbmsPort" Required="true" InURL="true" DefaultValue="1433"/>
<Attribute Name="DbmsUsername" Required="true" InURL="false"/>
<Attribute Name="DbmsPassword" Required="true" InURL="false"/>
</Driver>

Note: Post these and restart WebLogic Admin.

Create the Data Source for ADMINSERVERDS

  1. Select Services> Data.
  2. In the configuration section on the right, click New and select Generic Data Source.
  3. In the JDBC Data Source Properties pane that appears:
    1. Change the Name. This name can be anything, but has to be unique for the entire WebLogic server. If you have more than one OIPA instance on the server, then each instance should have a unique name.
    2. Change the JNDI Name to ADMINSERVERDS. This name cannot be anything other than ADMINSERVERDS.
    3. Select the MS SQL Server database type.
  4. Click Next.
  5. Select the driver - MS SQL Server Driver (Type 4) Versions:2005 and later Other
  6. Select Next.
  7. Select Next again when Transaction options are displayed.
  8. In the Connection Properties pane:
    1. Enter the Database Name.
    2. Enter the Host Name of the database server.
    3. Enter the Port number of the database server.
    4. Enter the Database user name. This can be obtained from the database administrator who installed the databases.
    5. Enter both password entries. This can be obtained from the database administrator who installed the databases.
    6. Select Next.
  9. On the next page for Test Database Connection modify the URL: field as shown in the below example, jdbc:sqlserver://slc03xxx.us.oracle.com:1900 to jdbc:sqlserver://slc03xxx.us.oracle.com:1900
  10. Test the database connection.
  11. Select Next.
  12. In the Select Targets pane that appears, check the box for the OIPA application server. This links the data source to the server that was created.
  13. Select Finish.

Create the Data Source for ADMINSERVERRESOURCEDS

  1. Select Services> Data Sources.
  2. In the configuration section on the right, click New and then select Generic Data Source.
  3. In the JDBC Data Source Properties pane that appears:
    1. Change the Name. This name can be anything, but has to be unique for the entire WebLogic server. If you have more than one OIPA instance on the server, each instance should have a unique name.
    2. Change the JNDI Name to ADMINSERVERRESOURCEDS.
    3. Select the database type.
    4. Select the driver type.
  4. Select Next.
  5. Select Next again when Transaction options are displayed.
  6. In the Connection Properties pane:
    1. Enter the Database Name.
    2. Enter the Host Name of the database server.
    3. Enter the Port number of the database server.
    4. Enter the Database user name for a readonly user. This can be obtained from the database administrator who installed the databases.
    5. Enter both password entries. This can be obtained from the database administrator who installed the databases.
    6. Select Next.
  7. On the next page for Test Database Connection modify the URL: field as shown in the below example jdbc:sqlserver://slc03xxx.us.oracle.com:1900 to jdbc:sqlserver://slc03xxx.us.oracle.com:1900
  8. Test the database connection.
  9. Select Next.
  10. In the Select Targets pane that appears, check the box for the OIPA application server. This links the data source to the servers that were was created.
  11. Select Finish.

Create the Data Source for ADMINSERVERSEARCHDS

  1. Select Services> Data Sources.
  2. In the configuration section on the right, click New and then Select Generic Data Source.
  3. In the JDBC Data Source Properties pane that appears:
    1. Change the Name. This name can be anything, but has to be unique for the entire WebLogic server. If you have more than one OIPA instance on the server, each instance should have a unique name.
    2. Change the JNDI Name to ADMINSERVERSEARCHDS.
    3. Select the database type.
    4. Select the driver type.
  4. Select Next.
  5. Select Next again when Transaction options are displayed.
  6. In the Connection Properties pane:
    1. Enter the Database Name.
    2. Enter the Host Name of the database server.
    3. Enter the Port number of the database server.
    4. Enter the Database user name for a readonly user. This can be obtained from the database administrator who installed the databases.
    5. Enter both password entries. This can be obtained from the database administrator who installed the databases.
    6. Select Next.
  7. On the next page for Test Database Connection modify the URL: field as shown in the below example jdbc:sqlserver://slc03xxx.us.oracle.com:1900 to jdbc:sqlserver://slc03xxx.us.oracle.com:1900
  8. Test the database connection.
  9. Select Next.
  10. In the Select Targets pane that appears, check the box for the OIPA application server. This links the data source to the servers that were was created.
  11. Select Finish.

Create Data Source for ADMINSERVERREADONLYDS

  1. Select Services> Data Sources.
  2. In the configuration section on the right, click New and then select Generic Data Source.
  3. In the JDBC Data Source Properties pane that appears:
    1. Change the Name to ADMINSERVERREADONLYDS.
    2. Change the JNDI Name to ADMINSERVERREADONLYDS.
    3. Select the database type.
    4. Select the driver type.
  4. Select Next.
  5. Select Next again when Transaction options are displayed.
  6. In the Connection Properties pane:
    1. Enter the Database Name.
    1. Enter the Host Name of the database server.
    2. Enter the Port number of the database server.
    3. Enter the Database user name for the readonly user. This can be obtained from the database administrator who installed the databases.
    4. Enter both password entries. This can be obtained from the database administrator who installed the databases.
    5. Select Next.
  7. On the next page for Test Database Connection modify the URL: field as shown in the below example jdbc:sqlserver://slc03xxx.us.oracle.com:1900 to jdbc:sqlserver://slc03xxx.us.oracle.com:1900
  8. Test the database connection.
  9. Select Next.
  10. In the Select Targets pane that appears, check the box for the OIPA application server. This links the data source to the servers that were was created.
  11. Select Finish.