Create a SQL Server JNDI data source on WebLogic
Procedure
-
Browse to the appropriate directory for your Java version, under
PolicyCenter/admin/lib.
Option Description Java 8 PolicyCenter/admin/lib/java8 -
Copy the mssql-jdbc-<version>.jar
JAR file to the server/lib directory within the WebLogic
home.
This JAR file contains the APIs for connecting to the PolicyCenter database.
-
Add the mssql-jdbc-<version>.jar
file to the classpath of the WebLogic domain by doing one of the
following:
Modify classpath for single domain
- Open the
WL_HOME
/common/bin/commEnvscript appropriate to your operating system in a text editor. - Prepend the absolute path to the
mssql-jdbc-<version>.jar
file, including the file name, to the
WEBLOGIC_CLASSPATHenvironment variable.
Modify classpath for multiple domains
- Open the
setDomainEnvscript appropriate to your operating system in a text editor. - Prepend the absolute path to the
mssql-jdbc-<version>.jar
file to the
PRE_CLASSPATHenvironment variable.
- Open the
WL_HOME
- Restart the WebLogic server for the change to take effect.
- Open the WebLogic Server Administration Console.
- Click .
- Click New to create a Generic Data Source.
-
Enter a Name and
JNDI Name for the
data source.
The JNDI name must match the value of the
datasource-nameattribute of the<jndi-connection-pool>element in the database-config.xml file. - Select MS SQL Server as the Database Type.
- Select Other as the Database Driver, and click Next.
- Uncheck Supports Global Transactions, and click Next.
- Specify connection properties for the SQL Server database, and click Next.
-
Enter
com.microsoft.sqlserver.jdbc.SQLServerDriverfor the Driver Class Name. -
Specify the URL
using the following format:
jdbc:sqlserver://servername:port;databasename=dbname;user=username -
Fill in the connection properties for your environment:
- Unicode database – Set the value of
sendStringParametersAsUnicodetotrue. - Single-byte database – Set the value
of
sendStringParametersAsUnicodetofalse.
- Unicode database – Set the value of
-
Click Test
Configuration.
If you configured the connection properly and the database is running, WebLogic displays the message “Connection test succeeded.”
- Click Next.
- Select the targets that use the data source.
-
Click Finish.
The WebLogic Server Administration Console returns you to the Summary of JDBC Data Sources screen.
-
Click Activate
Changes.
WebLogic displays the message “All changes have been activated. No restarts are necessary.”
