1
I have a multi-client JSP application.
Currently the database configuration is in a file variable.propriet, and obtain through the method
private static String getUrlBanco() {
ResourceBundle b = ResourceBundle.getBundle("Base.variavel");
return b.getString("urlbanco");
}
The problem is that it is not standard, the location of the base and the file is compressed along with War, which forces me to generate a War per client.
I wanted a way that this was set outside the application, I don’t know, by environment variable, by configuration in Tomcat...
I accept suggestions.
Consider using a JNDI entry in Tomcat. Then you map and consume on web.xml. So, you just need to restart your application,
– josivan
Ai the user and password of the bank would be "accessible" to the users
– HagaHood
The Tomcat and OS administrator, probably yes, for the application users would not be. Also, you can encrypt the password when mapping password as JNDI input in Tomcat.
– josivan
How do I map the encrypted password?
– HagaHood
Could you better contextualize this? Who is responsible for the database, the client or you? Why doesn’t the bank have a default place? You say access data is inside WAR in a text file. You think this is safe?
– utluiz
Who is responsible for the database? good question. Customers are responsible for DB, but they do not have the user and password(company policy)(he who has to do maintenance, but can not have access).
– HagaHood
Why the bank doesn’t have a standard place? pq are prefectures, and each one has a different default from where the bank is. most of the database is on a different Tomcat Server
– HagaHood
You say access data is inside WAR in a text file. You think this is safe? only the location of the database, user and password is inside a . java
– HagaHood