http://www.nutzam.com/core/appendix/create_datasource.html 中只提到了
Druid(推荐)
国产精品连接池,淘宝温少诚意出品,带强大的监控功能哦
druid : 直接书写 Java 代码
import com.alibaba.druid.pool.DruidDataSource;
...
DruidDataSource dds = new DruidDataSource();
dds.setDriverClassName("org.postgresql.Driver");
dds.setUrl("jdbc:postgresql://localhost:5432/mydatabase");
dds.setUsername("enzozhong");
dds.setPassword("123");
...
dds.close(); // 关闭池内所有连接
————————————————————————————————————————————————
而我的配置
————————————————————————————————————————————————
var ioc = {
baiChengDao: {
type: "org.nutz.dao.impl.NutDao",
args: [{
refer: "baiChengSource"
}]
},
baiChengSource: {
type: "com.alibaba.druid.pool.DruidDataSource",
events: {
//depose : 'close'
},
fields: {
driverClassName: "com.mysql.jdbc.Driver",
url: "jdbc:mysql:******",
username: "*****",
password: "********"
}
},
....
}