Create Data Sources – SQL Server

SQL Server driver is not available by default while configuring a datasource on WebLogic. Follow the below steps:

Update

Place the sqljdbc4.jar at $DOMAIN_HOME/lib

For Example: /scratch/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

For Example: /scratch/Oracle/Middleware/Oracle_Home/wlserver/server/lib/jdbcdrivers.xml

 

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

JDBC Drivers 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>

Create the Data Source for SERVICEDATASOURCE

  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:
  4. 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.
  5. Change the JNDI Name to SERVICEDATASOURCE. This name cannot be anything other than SERVICEDATASOURCE.
  6. Select the MS SQL Server database type.
  7. Click Next.
  8. Select the driver- MS SQL Server Driver (Type 4) Versions:2005 and later Other.
  9. Select Next.
  10. Select Next again when Transaction options are displayed.
  11. In the Connection Properties pane:
  12. Enter the Database Name.
  13. Enter the Host Name of the database server.
  14. Enter the Port number of the database server.
  15. Enter the Database user name. This can be obtained from the database administrator who installed the databases.
  16. Enter both password entries. This can be obtained from the database administrator who installed the databases.
  17. Select Next.
  18. On the next page for Test Database Connection modify the URL: field as shown in the below example, jdbc:sqlserver://serverName:portNumber
  19. Test the database connection.
  20. Select Next.
  21. 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.
  22. Select Finish.