本帖最后由 ecoolper 于 2019-3-10 16:02 编辑
dao.js代码片段 - dataSource : {
- type : "com.alibaba.druid.pool.DruidDataSource",
- events : {
- create : "init",
- depose : 'close'
- },
- fields : {
- url : {
- java : "$conf.get('db.erp.url')"
- },
- username : {
- java : "$conf.get('db.erp.username')"
- },
- password : {
- java : "$conf.get('db.erp.password')"
- },
- filters: "config",
- connectionProperties: {java:"$conf.get('db.erp.connectionProperties')"},
-
- testWhileIdle : true,
- validationQuery : "select 1",
- maxActive : {
- java : "$conf.getInt('db.erp.maxActive', 30)"
- }
- }
- },
复制代码
db.properties代码片段 - #erp db
- db.erp.url=jdbc:mysql:/x5.mysql.rds.aliyuncs.com/erp?zeroDateTimeBehavior=convertToNull
- db.erp.username=root
- #db.erp.password=x5
- db.erp.password=Fvbv9T6k45t1pMCTXPf737pPyA8DudllBFVx5HbG5I
- db.erp.connectionProperties=config.decrypt=true;config.decrypt.keyAwSAJBAK4JsP1Y3H1scJ2GE2uu2R3MQqG0iY73fZpxSF+WC/sM8dEsd0SIp6nYv
- db.erp.maxActive=30
复制代码
|