Domino Code Fragment
| Code Name* Using environment variables | Date* 06/09/2026 | Source (or email address if you prefer)* [email protected] IP address:.104.23.197.110 | |
| Description* 2. This agent example prints the value of a system environment variable. The second argument to getEnvironmentString is true so that a dollar sign is not prepended to the name of the environment variable. | Type* Java | Categories* (Misc) | |
| Implementation: | Required Client: | Server: |
| Limitations: | Comments: | |
class getenvironmentstring extends NotesThread
{
public static void main(String argv[])
{
getenvironmentstring t = new getenvironmentstring();
t.start();
}
public void runNotes()
{
try
{
Session s = Session.newInstance();
Database db;
String ms = s.getEnvironmentString("MailServer", true);
db = s.getDatabase(ms, "names.nsf");
System.out.println
("Title of names.nsf: \"" + db.getTitle() + "\"");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}