var ioc={
dao:{
type:"org.nutz.dao.impl.NutDao",
args:[{refer:"dataSource"}]
},
dataSource:{
type:"com.alibaba.druid.pool.DruidDataSource",
fields:{
driverClassName : "oracle.jdbc.driver.OracleDriver",
url : "jdbc:oracle:thin:10.1.1.173:sales",
username :"scmtest",
password : "scn*test*123",
testWhileIdle : true,
maxActive : 100
},
events:{
create:"init",
depose:"close"
}
},
}
@Test
public void test(){
fail("Not yet implemented");
}
Ioc ioc;
Dao dao;
@Before
public void before(){
ioc = new NutIoc(new JsonLoader("cn/tracy/nutz/ioc/dao.js"));
dao = ioc.get(Dao.class);
}
@After
public void after(){
if (ioc != null)
ioc.depose();
}
严重: create connection error, url: jdbc:oracle:thin:10.1.1.173:sales, errorCode 17002, state 08006
java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:536)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:228)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1464)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1529)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:223
@Test
public void test(){
fail("Not yet implemented");
}
Ioc ioc;
Dao dao;
@Before
public void before(){
ioc = new NutIoc(new JsonLoader("cn/tracy/nutz/ioc/dao.js"));
dao = ioc.get(Dao.class);
}
@After
public void after(){
if (ioc != null)
ioc.depose();
}