奇怪!!

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;

}

}
...全文
71 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
mzer 2001-09-27
  • 打赏
  • 举报
回复
开啦!
希望各位高人指点呀!
skyyoung 2001-09-26
  • 打赏
  • 举报
回复
你的oracle listener 开了吗。

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧