Create a SQL Server JNDI data source on WebLogic

Procedure

  1. Browse to the appropriate directory for your Java version, under PolicyCenter/admin/lib.
    OptionDescription
    Java 8 PolicyCenter/admin/lib/java8
  2. 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.

  3. 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/commEnv script 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_CLASSPATH environment variable.

    Modify classpath for multiple domains

    • Open the setDomainEnv script appropriate to your operating system in a text editor.
    • Prepend the absolute path to the mssql-jdbc-<version>.jar file to the PRE_CLASSPATH environment variable.
  4. Restart the WebLogic server for the change to take effect.
  5. Open the WebLogic Server Administration Console.
  6. Click Service > Data Source.
  7. Click New to create a Generic Data Source.
  8. Enter a Name and JNDI Name for the data source.

    The JNDI name must match the value of the datasource-name attribute of the <jndi-connection-pool> element in the database-config.xml file.

  9. Select MS SQL Server as the Database Type.
  10. Select Other as the Database Driver, and click Next.
  11. Uncheck Supports Global Transactions, and click Next.
  12. Specify connection properties for the SQL Server database, and click Next.
  13. Enter com.microsoft.sqlserver.jdbc.SQLServerDriver for the Driver Class Name.
  14. Specify the URL using the following format:
    jdbc:sqlserver://servername:port;databasename=dbname;user=username
  15. Fill in the connection properties for your environment:
    • Unicode database – Set the value of sendStringParametersAsUnicode to true.
    • Single-byte database – Set the value of sendStringParametersAsUnicode to false.
  16. Click Test Configuration.
    If you configured the connection properly and the database is running, WebLogic displays the message “Connection test succeeded.”
  17. Click Next.
  18. Select the targets that use the data source.
  19. Click Finish.
    The WebLogic Server Administration Console returns you to the Summary of JDBC Data Sources screen.
  20. Click Activate Changes.
    WebLogic displays the message “All changes have been activated. No restarts are necessary.”