简体   繁体   中英

ORA-28040: No Authentication protocol

I am trying to connect to remote DB via simple JDBC but i am getting below

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. I am able to connect to remote via VPN but not via JDBC .. any guidance much appreciated...

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.

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 .

Check this issue for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM