Connection to MS SQL server database from PEGA
We need to connect to a Microsoft SQL server database from PEGA 8.2.2 which is running on IBM Websphere 8.5.5.
1. I have created a data source "ABC" with JNDI name as "jdbc/ABC" in IBM websphere console, provided database name, server name, port number, user name and password in console.
2. Test Connection from Websphere console is working fine for this data source
3. Created a database instance rule in PEGA and configured its how to connect as "use JDBC Connection pool" and JNDI name as "jdbc/ABC". On save of rule getting below error
The JNDI name of the Data Source used to connect to this DB—
The DataSource jdbc/ABC is invalid: Unable to obtain DataSource object: code: <none> SQLState: Context: <XXXX>, name: jdbc/ABC: First component in name ABC not found. Message: <none>
DatabaseException caused by prior exception: javax.naming.NameNotFoundException: Context: <XXXX>/clusters/<XXX>_cluster1, name: jdbc/ABC: First component in name ABC not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
4. I believe this error is cause I have not defined this data source in prconfig.xml file.
Trying to figure out the syntax to define this data source in prconfig file. On PDN, I have seen articles where its asking to mention below settings but in my case, I believe its not required as I have already given database details, user name and password in web console.
Should I just give this setting?
<env name="database/databases/ABC/dataSource" value="ABC"/>
Also, is it required to again give driver name in prconfig.xml like below? I have already copied sql jar file on my server and have mentioned path in jdbc provider class path.
<env name="database/drivers" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
Keep up to date on this post and subscribe to comments
- Unable to Connect to SQL Server Database from Pega 7
- External database connectivity- Pega 8.1.3 & MS SQL Server 2017
- Pega to SQL Server Database Connection
- Can we create database instance, which connects to SQL server database with windows authentication?
- How to connect Sql server and fetch data from database and store it into Excel in openSpan