Announcement
Collapse
No announcement yet.
X
-
Yes, you can do this as follows:
Code:-Disc_config:db.host=localhost
As of 12.1 (not yet released as of the time of this of this writing), you'll be able do do this:
Code:sql.defaultDatabase.driver.serverName: $SYS{db.host}
One note on this: command line properties can observed from the process listing on most operating systems, so be careful with passing sensitive data like passwords in this manners. You can use environment variables:
Code:sql.defaultDatabase.driver.serverName: $ENV{ENV_VAR_NAME}
Leave a comment:
-
server.properties with Java System Properties
How do I reference Java system properties in the server.properties file?
I'm passing in values to the JVM using the -D flag, ie: -Ddb.host=localhost
I'm trying to configure a database connection, here's the relevant block from my server.properties:
Code:sql.defaultDatabase:Mysql sql.defaultDatabase.type:mysql sql.defaultDatabase.interface.type:dataSource sql.defaultDatabase.driver:org.mariadb.jdbc.MariaDbDataSource sql.defaultDatabase.driver.serverName:${db.host} sql.defaultDatabase.driver.portNumber:3306 sql.defaultDatabase.driver.databaseName:${db.name} sql.defaultDatabase.driver.user:${db.user} sql.defaultDatabase.driver.password:${db.password}
Right now I get the error:
Code:java.lang.Exception: variable expansion failed for variable: db.host
Tags: None
Leave a comment: