Wednesday, July 22, 2020

DatabaseConnection

public class DBConnection {

            public static Connection getJDBConnection(String dbUrl, String userName, String password){  

                              Connection connection = null;                

try {                           

                              Class.forName("oracle.jdbc.driver.OracleDriver");

                              connection = DriverManager.getConnection(dbUrl,userName,password);

                              System.out.println("Database connection is successful : ");

               

                              catch (Exception e) {

                              System.out.println("Error in Database Connection : "+e.getMessage());

               }                 

finally{

if(connection != null){

connection.close();

}        

}  

        return connection;

    }    


               Note : Servicename = /OIMDEV, SID = :OIMDEV

                         String dbUrl = "jdbc:oracle:thin:@HOSTNAME:1521/OIMDEV";

                         String userName = "dev_oim";

                         String password = "Welcome123";

 


No comments:

Post a Comment

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...