奇怪!!

mzer 2001-09-25 12:13:17
ORACLE难道和网卡有关系!!错误如下:
the network adapter could not establish the connection

JAVABEAN的代码如下:

package net.cnnic.midwest;

import java.io.*;
import java.sql.*;
import java.util.*;

public class ConnectionBean
{
private static Connection conn = null;
// The machine on which the database resides
public static String hostname="123.123.123.123";
// The TNS listener port
public static String port="1521";
// The database name (SID)
public static String dbSID="mian";
// The database User ID
public static String username="test";
// The database user password
public static String password="test";

public static Connection getConnection()
{
if (conn == null)
{
try
{
hostname=System.getProperty("s_hostName","123.123.123.123");
System.out.println("dbsid:"+hostname);
port=System.getProperty("s_tnsPort","1521");
dbSID=System.getProperty("s_databaseSID","main");
System.out.println("dbsid:"+dbSID);
username=System.getProperty("s_userName","test");
System.out.println("user:"+username);
password=System.getProperty("s_Password","test");
System.out.println("pass:"+password);
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:@"+hostname+":"+port+":"+dbSID,username,password);
} catch(SQLException e)
{
e.printStackTrace();
return null;
}
}
return conn;

}

}
...全文
27 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
mzer 2001-09-27
开啦!
希望各位高人指点呀!
回复
skyyoung 2001-09-26
你的oracle listener 开了吗。
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2001-09-25 12:13
社区公告
暂无公告