5

I am trying to connect to oracle12c database using groovy.sql.Sql

Sql sql = Sql.newInstance('jdbc:oracle:thin:@'+hostName:port/serviceName, dbUser, dbPassword, 'oracle.jdbc.driver.OracleDriver')

and it returns

java.sql.SQLException: ORA-28040: No matching authentication protocol

I guess, this is because of the dialect mismatch.

It works fine with oracle11g, but not with 12c. If it is a problem with dialect, how can we externally specify dialect to groovy.sql.Sql. If not, what could be the problem/solution?

I'm using ojdbc14 driver.

Syam
  • 575
  • 2
  • 8
  • 25

2 Answers2

9

The ojdbc14 is a relatively old driver and that could be the problem. I would recommend trying ojdbc6 and see if that fixes your problem.

Note that this appeared to fix a similar problem based on information in the comments in this SO question ORA-28040: No matching authentication protocol exception.

Community
  • 1
  • 1
John Wagenleitner
  • 10,967
  • 1
  • 40
  • 39
0

Are you referring to the dialect that is normally configured in DataSource.groovy? If so, this is irrelevant when creating an Sql instance, because the dialect is only used by Hibernate/GORM.

Dónal
  • 185,044
  • 174
  • 569
  • 824
  • No, actually I am trying to dynamically connect to some other databases from my application. – Syam Aug 06 '14 at 11:02