1

I had problem when connecting to Oracle Cloud Database from java code.

  • I have no problem connecting other non-cloud oracle databases.

  • I can connect to the Oracle Cloud Database with sql tools, except from the java codes.

  • The hostname, username and password is correct one, i don't reveal the real username and password.

Error: java.sql.SQLException:

SQLException: SQLState(null) vendor code(17002)
java.sql.SQLException: Io exception: Oracle Error ORA-12650: No common encryption or data integrity algorithm

My code as following:

String dbURL = "jdbc:oracle:thin:@192.133.133.23:1521:ORCL";

try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection(dbURL, "username1", "password");


}catch(Exception)
{
  e.printStacktrace();
}
3
  • "ORA-12650: No common encryption or data integrity algorithm" psoug.org/oraerror/ORA-12650.htm Commented Jan 8, 2016 at 11:05
  • yup, i will re-edit the post with this message Commented Jan 8, 2016 at 11:05
  • Try this post from Oracle community which might help.. It seems you have to setup your SQLNET.ORA appropriately for JDBC thin client which it seems is what you are using Commented Jan 8, 2016 at 11:10

3 Answers 3

1
/**
 * The below one is for oracle thin client
   Its worked for the ojdbc6 driver. 
 */
public Connection conCheck() {

      Connection con=null;
      try { //step1 load the driver class
      Class.forName("oracle.jdbc.OracleDriver");

      Properties props = new Properties();
      props.put("oracle.net.encryption_client", "REQUIRED");
      props.put("oracle.net.encryption_types_client",  "( " + AnoServices.ENCRYPTION_AES256 + "," +AnoServices.ENCRYPTION_AES192 + ")");
      props.put("oracle.net.crypto_checksum_types_client", "( SHA1 )");
      props.put("user", "username");
      props.put("password","password");

    //step2 create  the connection object          
      con=DriverManager.getConnection(  "jdbc:oracle:thin:@host:port:serveiceid",props);

       System.out.println("Con"+con);
      }catch(Exception e) {e.printStackTrace(); }       

 return con;
}
Sign up to request clarification or add additional context in comments.

Comments

0

Seems like changing syntax in your connection string to lookup SERVICE_NAME instead of SID must help you connect your database.

String dbURL = "jdbc:oracle:thin:@192.133.133.23:1521/ORCL";

Additional Read : Thin-style Service Name Syntax

If this as well doesn't help, then would suggest to add below 2 lines to your sqlnet.ora in database.

SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT= (SHA1)
SQLNET.CRYPTO_CHECKSUM_CLIENT = requested

Comments

0

First mandatory check is to verify the oracle jdbc version. if you use incompatible version,we will get this kid of errors.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.