毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> java技术 >> 正文

java.net.ConnectException: Connection refused: connect

更新时间:2012-5-25:  来源:毕业论文

错误信息:
建立conn出错:java.sql.SQLException: JZ006: 捕获到 IO 例外:java.net.ConnectException: Connection refused: connect

代码:
Driver driver = null;
Connection conn = null;
String DRIVER = "";
String _URL = "";
String USERNAME = "";
String PASSWORD = "";
Properties props = new Properties();
//public String serverInfo = "D:/Program Files/Apache Software "
// + "Foundation/Tomcat 5.5/webapps/FlexDemo/params.ini";

// public String serverInfo = "/usr/tomcat/webapps/repo/params.ini";

public Connection getCon() {
try {
//File f = new File(serverInfo);
// System.out.print(System.);
//FileInputStream is = new FileInputStream(f);
//props.load(is);
DRIVER = props.getProperty("DRIVER",
"com.sybase.jdbc3.jdbc.SybDataSource");
_URL = props.getProperty("URL", "jdbc:sybase:Tds:10.34.1.19:4100/Kustom?charset=eucgb");
USERNAME = props.getProperty("USERNAME", "sa");
PASSWORD = props.getProperty("PASSWORD", "frodo12");

driver = (Driver) Class.forName(DRIVER).newInstance();
DriverManager.registerDriver(driver);
conn = DriverManager.getConnection(_URL, USERNAME, PASSWORD);
} catch (Exception e) {
System.out.println("建立conn出错:" + e);
}
return conn;
}
连接成功。
已尝试用此进行连接:
HOSTNAME=zhangbo_8104;SERVERNAME=helonglong;USER=sa;JCONNECT_VERSION=0;PASSWORD=***;<HOST>=zhangbo_8104;<PORT>=5000
 

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。