I have a code that I want to publish. The code sends e-mail through servers, connects to databases and other tasks requiring usernames / passwords.
I would like to store passwords, etc. in a separate configuration file, so I donβt need to sanitize my code with every commit.
How can i do this? This would be easy to do in C using #define, but I'm not sure how to do it in Java.
EDIT: The environment I use is Glassfish
Properties . J2EE, , .
, , , , J2EE, . "" , javadoc load().
, . . JDBC Resources , . jdbc/myappname.
J2EE5 :
@Resource (mappedName = "jdbc/myappname" ) DataSource myDS;
. , , :
conn = myDS.getConnection();
. , . , , , , EJB, , JSF bean.
Source: https://habr.com/ru/post/1775322/More articles:Does SLIME have a hotkey for commenting a block of Lisp code in slime-mode? - commentsJust can't get Entity Framework to pull what I want - c #Development Methodology for Immature Teams - agilereduce equivalent in jQuery? - jqueryProblem with Computing Workflow - f #linq join table with collection - linqTable history trigger in SQL Server? - sql-serverFormat timestamp CSLogItem (since?) (NSTimeInterval) - objective-cUsing Apache Sling Scala 2.8 Script Engine - scriptingHow to do a real-time database poll in MySQL / PHP? - jqueryAll Articles