[英]ORA-28040: No Authentication protocol
I am trying to connect to remote DB via simple JDBC but i am getting below 我正在尝试通过简单的JDBC连接到远程数据库,但是我在下面
error:
*** SQLException caught ***
ORA-28040: No matching authentication protocol
code : 代码:
import java.sql.*;
import oracle.jdbc.*;
import java.io.*;
import oracle.jdbc.pool.OracleDataSource;
public class JDBC {
public static void main (String args []) throws SQLException {
try
{
//Connecting to Oracle server
OracleDataSource ds = new oracle.jdbc.pool.OracleDataSource();
ds.setURL("jdbc:oracle:thin:@remotehostname:1521:dbname");
Connection conn = ds.getConnection("my username", "my password");
System.out.println("Connected to DB");
}
catch (SQLException ex) { System.out.println ("\n*** SQLException
caught ***\n" + ex.getMessage());}
catch (Exception e) {System.out.println ("\n*** other Exception caught ***\n");}
}
}
I have added ojdbc6.jar and all supporting jars to build path. 我添加了ojdbc6.jar和所有支持的jar来构建路径。 I am able to connect to remote via VPN but not via JDBC .. any guidance much appreciated...
我能够通过VPN而不是通过JDBC连接到远程..任何指导表示赞赏...
From docs.oracle.com If the client version does not meet or exceed the value defined by SQLNET.ALLOWED_LOGON_VERSION_SERVER parameter(sqlnet.ora file), then authentication fails with an ORA-28040: No matching authentication protocol error or an ORA-03134: Connections to this server version are no longer supported error. 来自docs.oracle.com如果客户端版本未达到或超过SQLNET.ALLOWED_LOGON_VERSION_SERVER参数(sqlnet.ora文件)定义的值,则认证失败并显示ORA-28040:无匹配的认证协议错误或ORA-03134:不再支持与此服务器版本的连接错误。
You can check your driver version using below command 您可以使用以下命令检查驱动程序版本
$java -jar ojdbc6.jar -getversion
Try setting SQLNET.ALLOWED_LOGON_VERSION_SERVER in sqlnet.ora file to lower Oracle version like 8,9 or 10 . 尝试将sqlnet.ora文件中的SQLNET.ALLOWED_LOGON_VERSION_SERVER设置为较低的Oracle版本,例如8,9或10。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.