Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dbConnection;
- import java.util.ResourceBundle;
- /**
- * Class for database parameters
- */
- public class ConfigurationManager {
- /**
- * Database user
- */
- private String user;
- /**
- * Database password
- */
- private String pass;
- /**
- * Database url
- */
- private String uri;
- /**
- * Database driver
- */
- private String driver;
- /**
- * File with resources
- */
- private ResourceBundle resources;
- public ConfigurationManager()
- {
- resources = ResourceBundle.getBundle("data");
- initSettings();
- }
- public ConfigurationManager(String propertyFile)
- {
- resources = ResourceBundle.getBundle(propertyFile);
- initSettings();
- }
- private void initSettings()
- {
- user = resources.getString("user");
- pass = resources.getString("password");
- uri = resources.getString("url");
- driver = resources.getString("driver");
- }
- public String getUser() {
- return user;
- }
- public String getPass() {
- return pass;
- }
- public String getUri() {
- return uri;
- }
- public String getDriver() {
- return driver;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement