Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Can we execute query to Saviynt database in custom jar?

sunilsaurabh
New Contributor II
New Contributor II

Hi Experts,

I hope you are doing well!

Can we execute query to Saviynt database in custom jar? If yes, then sample code please?

I have seen freshDesk link in lots of past post for some documents, when i click it does not work. Does anyone have alternate link.

for example : https://forums.saviynt.com/t5/identity-governance/preprocessor-jar-file/m-p/11461#M3183

 Documentation : https://saviynt.freshdesk.com/support/solutions/articles/43000571860-normalizing-the-identity-data-u...

Logger https://saviynt.freshdesk.com/support/solutions/articles/43000527658-logger-configuration 

Thanks, much appreciated!

Kind regards,

Sunil

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

You can use standard jdbc configuration in custom jar and call external jar.

 

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class MSSQLExample {
public static void main(String[] args) {
String connectionUrl = "jdbc:sqlserver://yourserver:1433;databaseName=yourdatabase;user=yourusername;password=yourpassword;";

try (Connection con = DriverManager.getConnection(connectionUrl);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT TOP 10 * FROM yourtable")) {

while (rs.next()) {
System.out.println(rs.getString(1) + " " + rs.getString(2));
}
} catch (Exception e) {
e.printStackTrace();
}
}
}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak ,

Thanks for quick response.

Can we query to Saviynt database like this? If yes, Where can i find the connection URL for Saviynt database?

Kind regards,

Sunil

No you can’t 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.