Skip to content

Commit

Permalink
Merge pull request #280 from sumeetphadnis/master
Browse files Browse the repository at this point in the history
Set DB user and password read from Space in Properties
  • Loading branch information
ar authored Aug 14, 2023
2 parents 5164117 + 779d1f1 commit 674af76
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/dbsupport/src/main/java/org/jpos/ee/DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,14 @@ private Metadata getMetadata() throws IOException, ConfigurationException, Docum
Space sp = SpaceFactory.getSpace("tspace:dbconfig");
String user = (String) sp.inp(dbPropertiesPrefix +"connection.username");
String pass = (String) sp.inp(dbPropertiesPrefix +"connection.password");
if (user != null)
if (user != null) {
ssrb.applySetting("hibernate.connection.username", user);
if (pass != null)
dbProps.setProperty("hibernate.connection.username", user);
}
if (pass != null) {
ssrb.applySetting("hibernate.connection.password", pass);
dbProps.setProperty("hibernate.connection.password", pass);
}
}
MetadataSources mds = new MetadataSources(ssrb.build());

Expand Down

0 comments on commit 674af76

Please # to comment.