Quantcast
Channel: java – Laurent Schneider
Viewing all articles
Browse latest Browse all 22

old jdbc driver generates ORA-28040

0
0

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.

O12.java


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");
    DriverManager.registerDriver(new
      oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection(
      argv[0], props);
    System.out.println("JDBC Version: "+
      conn.getMetaData().getDriverVersion());
    conn.close();
  }
}

compile


javac -cp ojdbc14.jar O12.java

test with jdbc 10.2.0.2 db 11.2.0.4


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

test with jdbc 10.2.0.2 db 12.1.0.2


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 11.2.0.1 db 12.1.0.2


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

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


Viewing all articles
Browse latest Browse all 22

Latest Images

Trending Articles





Latest Images