Question

4
Replies
1210
Views
dannyc21 Member since 2016 11 posts
Facebook
Posted: 3 years ago
Last activity: 3 years 2 months ago
Closed

How to get Database "java.sql.Connection" in a java step from an existing Database instance

I needed to write a very custom java.sql.PreparedStatement in a java step and the only missing piece is the "java.sql.Connection" object. Is there any Pega Engine API that will get this java object assuming I have the Database name and/or JDBC URL. Also, I have tried the following it works but I do not want to hardcode the password.

//Works but I don't want to hardcode the password

java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@dev.mycompany.com:8091:DEV", "username", "password");

//Note: getConnection("jdbc:url") signature does not work since password is require to get the instance

Data Integration Java and Activities
Moderation Team has archived post
Share this page LinkedIn