NutzCN Logo
问答 nutz能配置两个h2数据库么?
发布于 1974天前 作者 qq_e79520c3 1674 次浏览 复制 上一个帖子 下一个帖子
标签:

我需要离线更新h2某些表,就是直接替换掉h2表的保存文件,这样会把不需要更新的表也替换掉,所有想分数据库保存

3 回复

如果是dao.js, 多写一对 dao2/dataSource2就可以了

var ioc = {
		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"}]
//			fields : {
//				executor : {refer:"cacheExecutor"}
//			}
		},
	dataSource2 : {
		factory : "$conf#make",
		args : ["com.alibaba.druid.pool.DruidDataSource", "db2."],
		type : "com.alibaba.druid.pool.DruidDataSource",
		events : {
			create : "init",
			depose : 'close'
		}
	},
	dao2 : {
		type : "org.nutz.dao.impl.NutDao",
		args : [{refer:"dataSource2"}]
		//			fields : {
		//				executor : {refer:"cacheExecutor"}
		//			}
	},

----------------------------------------这样么

是的

来自炫酷的 NutzCN

添加回复
请先登陆
回到顶部