java ORA-28040:在 oracle12c 中使用 groovy.sql 包时没有匹配的身份验证协议异常
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25143344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-28040: No matching authentication protocol exception when using groovy.sql package with oracle12c
提问by Syam
I am trying to connect to oracle12cdatabase using groovy.sql.Sql
我正在尝试使用groovy.sql.Sql连接到oracle12c数据库
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 dialectmismatch.
我想,这是因为方言不匹配。
It works fine with oracle11g, but not with 12c. If it is a problem with dialect, how can we externally specify dialectto groovy.sql.Sql. If not, what could be the problem/solution?
它适用于oracle11g,但不适用于12c。如果是方言的问题,我们如何在外部指定方言到groovy.sql.Sql。如果没有,可能是什么问题/解决方案?
I'm using ojdbc14driver.
我正在使用ojdbc14驱动程序。
回答by John Wagenleitner
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.
这ojdbc14
是一个相对较旧的驱动程序,这可能是问题所在。我建议您尝试ojdbc6
一下,看看是否能解决您的问题。
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.
请注意,根据此 SO 问题ORA-28040: No matching authentication protocol exception中的评论中的信息,这似乎解决了类似的问题。
回答by Dónal
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.
您指的是通常配置的方言DataSource.groovy
吗?如果是这样,这在创建Sql
实例时无关紧要,因为方言仅由 Hibernate/GORM 使用。