NutzCN Logo
问答 nutz连接oracle报错。求指教
发布于 2663天前 作者 qq_51f683aa 1832 次浏览 复制 上一个帖子 下一个帖子
标签:

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();
    }
3 回复

远程服务器?? 防火墙没关吧

是远程服务器,但是我用SSH连接数据库都是可以的,就只是nutz有影响吗?

你可以用JDBC试一下

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