亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1598 | 回復(fù): 1
打印 上一主題 下一主題

java oracle 連接錯(cuò)誤 謝謝解答!! [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2006-09-11 19:31 |只看該作者 |倒序?yàn)g覽
一下為員代碼,編譯通過:
import java.sql.*;

class test
{
public static void main (String args [])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
/* try{
Class.forName("oracle.jdbc.driver.OracleDriver";
}catch(Exception e){
System.out.println("No Driver!";
}
*/
// Connect to the database
// You must put a database name after the @ sign in the connection URL.
// You can use either the fully specified SQL*net syntax or a short cut
// syntax as ::. The example uses the short cut syntax.
String url = "jdbcracle:thin202.197.237.90:1521:mydomain";
String userName = "scott";
String password = "tiger";

if (args.length > 0) url = args[0];
if (args.length > 1) userName = args[1];
if (args.length > 2) password = args[2];
System.out.println(url);
System.out.println(userName);
System.out.println(password);
Connection conn =
DriverManager.getConnection (url, userName, password);

// Create a Statement
Statement stmt = conn.createStatement ();

// Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select * from Test";

// Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}

錯(cuò)誤提示:
Exception in thread "main" java.sql.SQLException: Io 異常: The Network Adapter c ould not establish the connection
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :125)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :162)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :274)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:322)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java: 347)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:150)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio n.java:32)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:549)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at test.main(test.java:31)
給點(diǎn)建議呀!!

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2006-09-11 20:41 |只看該作者
我已經(jīng)找到原因了,沒有打開監(jiān)聽進(jìn)程。!
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP