【发布时间】:2014-09-19 08:14:26
【问题描述】:
我继承了一些使用 derby 数据库的源代码,但无法启动服务器。
public void startDatabase(){
try {
Class.forName("org.apache.derby.jdbc.ClientDriver");
System.setProperty("derby.system.home", "D:\\runtime-my.product\\log");
NetworkServerControl nsc = new NetworkServerControl(InetAddress.getByName("localhost"), 1527)
nsc.start(null);
nsc.ping();
catch (Exception e){
e.printStackTrace();
}
}
nsc.ping()执行时,抛出如下异常:
Exception: java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby Network Server on host 127.0.0.1, port 1527: Connection refused: connect
这些代码行有什么明显的缺失或错误吗?
【问题讨论】: