old jdbc driver generates ORA-28040

I read on note 401934.1 that Oracle 10gR2 jdbc clients are still supported with Oracle 12c.

I have an application using an oracle10gr2 jdbc, and connection to 12c generates ORA-28040.

Connection to 11gR2 works like a charm.


import java.util.Properties;
import java.sql.*;

public class O12 {
public static void main(String argv[]) throws
SQLException {
Properties props = new Properties();
props.setProperty("user", "scott");
props.setProperty("password", "tiger");
Connection conn = DriverManager.getConnection(
argv[0], props);
System.out.println("JDBC Version: "+


javac -cp ojdbc14.jar O12.java

test with jdbc db

java -cp ojdbc14.jar:. O12 jdbc:oracle:thin:@DB11204:1521:DB11204
JDBC Version:

test with jdbc db

java -cp ojdbc14.jar:. O12 jdbc:oracle:thin:@DB12102:1521:DB12102
Exception in thread "main" java.sql.SQLException: ORA-28040: No matching authentication protocol

The easy solution of course is to update the driver. Even without recompile it worked.

test with jdbc db

java -cp ojdbc5.jar:. O12 jdbc:oracle:thin:@DB12102:1521:DB12102
JDBC Version:

Before upgrading the db server to 12c, check 10g jdbc jar’s are upgraded

Categorized as 12c, java Tagged

By Laurent Schneider

Oracle Certified Master


  1. It still will work, if SQLNET.ALLOWED_LOGON_VERSION is set to old value (i.e. 10).
    Of course, it’s better to update the jdbc driver anyway.

  2. Thanks Lucas. It is a good hint, with a 11gR2 listener, I could even connect with jdbc 9i to a 12c database.

    java -cp .:classes12.jar O12 jdbc:oracle:thin:@DB12102:1521:DB12102
    JDBC Version:

    However, with a 12cR1 listener and SQLNET.ALLOWED_LOGON_VERSION_SERVER=10 and jdbc, I still get the same ORA-28040

  3. I found on Metalink, you can also do

    java -cp .:classes12.jar O12 "{oracle.jdbc.V8Compatible=true}jdbc:oracle:thin:@DB12102:1521:DB12102"
    JDBC Version:

    This works with a 12c listener

Leave a comment

Your email address will not be published.