Guest User

Untitled

a guest
Oct 26th, 2017
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public static Connection getAMSConnection() {
  2.  
  3. Connection amsConnection = null;
  4. log.info("Inside getAMSConnection method to retrieve the connection from AMS Database ");
  5.  
  6. try {
  7. String userName = hibernate_username;
  8. String password = hibernate_password;
  9. String url = hibernate_url;
  10. String driverName = hibernate_driver_name;
  11. Class.forName(driverName);
  12. amsConnection = DriverManager.getConnection(url, userName, password);
  13. } catch (ClassNotFoundException classNotFoundException) {
  14. log.error("Not able to connect to AMS DB due to Dbconnection getAMSconnection " + classNotFoundException);
  15. } catch (SQLException sqlException) {
  16. log.error("Not able to connect to AMS DB due to Dbconnection getAMSconnection " + sqlException);
  17. }
  18.  
  19. return amsConnection;
  20. }
Add Comment
Please, Sign In to add comment