我项目中用到双数据库,其中一个数据库需要在setup中判断是否包含某个视图,但是我这个代码默认是检查默认数据库,请问怎么切换,代码放短点了
http://www.nutz.cn/s/c/mW
4 回复
我配置了dao.json
{
"conf" : {
"type" : "org.nutz.ioc.impl.PropertiesProxy",
"fields" : {
"paths" : ["config/custom/"]
}
},
"dataSource" : {
"factory" : "$conf#make",
"args" : ["com.alibaba.druid.pool.DruidDataSource", "db."],
"type" : "com.alibaba.druid.pool.DruidDataSource",
"events" : {
"create" : "init",
"depose" : "close"
}
},
"dao" : {
"type" : "org.nutz.dao.impl.NutDao",
"args" : [{"refer":"dataSource"}]
},
"dataSourceB" : {
"factory" : "$conf#make",
"args" : ["com.alibaba.druid.pool.DruidDataSource", "db2."],
"type" : "com.alibaba.druid.pool.DruidDataSource",
"events" : {
"create" : "init",
"depose" : "close"
}
},
"daoB" : {
"type" : "org.nutz.dao.impl.NutDao",
"args" : [{"refer":"dataSourceB"}]
}
}
其他还怎么做才能在setup中获取到daoB,文档有的话可以发个链接吗?大叔
添加回复
请先登陆