java.sql.SQLRecoverableException: IO 错误: NL 异常已生成

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44526756/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:13:33  来源:igfitidea点击:

java.sql.SQLRecoverableException: IO Error: NL Exception was generated

javaoracle-sqldeveloper

提问by Mithilesh Indurkar

Getting java.sql.SQLRecoverableException: IO Error: NL Exception was generated

获取 java.sql.SQLRecoverableException: IO Error: NL Exception was generated

Trying to connect to Oracle sql developer DB.

尝试连接到 Oracle sql 开发人员数据库。

Connection string used is :

使用的连接字符串是:

 jdbc:oracle:thin:@(DESCRIPTION=(CID=ValidCID)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ValidHost)(PORT=1521)))(CONNECT_DATA=(SID =ValidSID)(SERVER = DEDICATED))); User Id=UID;Password=Pwd;

I use the same set of parameters while connecting from QTP. What could be the issue here ?

从 QTP 连接时,我使用相同的参数集。这可能是什么问题?

采纳答案by Mithilesh Indurkar

I found it...

我找到了...

instead of supplying User ID and password through connection string, one needs to supply them through the method. So, my connection string would become

不是通过连接字符串提供用户 ID 和密码,而是需要通过方法提供它们。所以,我的连接字符串会变成

 String strConnString = "jdbc:oracle:thin:@(DESCRIPTION=(CID=ValidCID)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ValidHost)(PORT=1521)))(CONNECT_DATA=(SID =ValidSID)(SERVER = DEDICATED)))";

and I would use the following method to creation a connection

我会使用以下方法来创建连接

 Connection con = DriverManager.GetConnection(strConnString, UserID, Password);