Oracle已經聲明11g R2支持IPV6,而ojdbc6.jar是正確的。Oracle 11gR2確實支持IPV6嗎?
但是,當我測試它,我得到例外,你解決了嗎?
我的測試代碼:
import java.sql.SQLException;
import java.util.Properties;
public class Test {
final static String sDBDriver = "oracle.jdbc.driver.OracleDriver";
/**
* @param args
* @throws SQLException
*/
public static void main(String[] args) throws SQLException {
// TODO Auto-generated method stub
java.sql.Connection conn=null;
String url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=
[fe80::b056:5cff:fe78:b672])(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=fnstdb1))";
try
{
Class.forName(sDBDriver);
conn = DriverManager.getConnection(url,"scott","fnst1234");
}
catch (Exception e)
{
System.out.println("ERROR:"+e.getMessage());
}
finally
{
System.out.println("連接是否關閉:"+conn.isClosed());
conn.close();
}
}
}
和我用下面的CMD:
java -cp ojdbc6.jar -Djava.net.preferIPv6Addresses=true Test
但結果是:ERROR:NL Exception was generated
有什麼不對?
我想這是值得一提的是,你問對[OTN]這個問題(https://forums.oracle.com/forums/thread.jspa?threadID=2389637)了。 –
什麼是異常的堆棧跟蹤? –
是的,我在oracle論壇上問過這個問題,我很抱歉,但是我一直對此感到困惑,有誰能給我一個問題? – user1402674