Friday, May 3, 2024

Database Connection

 public static Connection getConnection(){

    String url = "DBURL";

    String user = "spadmin";

String pwd = "p1213#%$#^$%#&^";    

Connection connection;

 log.error("Intializing connection");

 Properties connectionProperties = new Properties();

         connectionProperties.put("user", user);

        connectionProperties.put("password", context.decrypt(pwd));

        connection = DriverManager.getConnection(url, connectionProperties);        

        return connection;

}


No comments:

Post a Comment

Content Assist set up in Eclipse

# Open the Eclipse application # Navigate to Windows > click on Preferences # Navigate to Java and expand it # Navigate to Editor a...