通过JDBC瘦驱动程序(Domino Java)连接Oracle 11g时出现问题

我无法使用以下代码远程连接Oracle 11数据库。 但是,如果我尝试连接安装在我的计算机上的Oracle 9数据库,相同的代码工作正常。 缺什么 ?

(我没有收到任何错误,Lotus Notes挂起)

import lotus.domino.*; import java.sql.*; import oracle.jdbc.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); Database db = agentContext.getCurrentDatabase(); //Calling connection method Connection conn= getOracleConnection(db); if(conn!=null){ System.out.println("Connected.."); } else { System.out.println("There is a problem in connecting database.."); System.exit(0); } } catch(Exception e) { e.printStackTrace(); System.exit(0); } } private static Connection getOracleConnection(Database db) throws Exception { // Register driver DriverManager.registerDriver (new oracle.jdbc.OracleDriver()); //Retrieving connection string from profile document. String host = "SPRPRG020.int.server.com"; String ip = "1521"; String user = "system"; String password = "password"; String sid = "XE"; String url="jdbc:oracle:thin:@"+host+":"+ip+":"+sid; return DriverManager.getConnection(url, user, password); } } 

好的伙计们,现在我能够连接..以下是我尝试过的所有可能的连接字符串,所有工作,

 1- "jdbc:oracle:thin:@server.cgg.com:1569:ServiceName" 2- "jdbc:oracle:thin:@//server.cgg.com:1569/ServiceName" 3- "jdbc:oracle:thin:@server.cgg.com:1569/ServiceName" 

我不久前偶然发现了这篇文章,试一试: Oracle SID!= SERVICE_NAME

使用此,oracle 11 g的JDBC URL语法已更改