gpt4 book ai didi

oracle - 带有 Oracle 厚 OCI 驱动程序的 Grails 使用错误的用户向 Oracle 进行身份验证

转载 作者:行者123 更新时间:2023-12-02 07:04:26 25 4
gpt4 key购买 nike

我已通过在

中添加以下行,使用存储在 Oracle 钱包中的证书设置对 Oracle 进行身份验证

sqlnet.ora。 sqlnet.ora 位于我的 Linux 主目录中。

 WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = my_wallet_location)
)
)

SQLNET.WALLET_OVERRIDE = TRUE

并在DataSource.groovy中将用户名和密码设置为“”

 username=""
password=""

然而,在我启动我的 grails 应用程序后,我发现我的应用程序进行了操作系统身份验证,这使我以 ops$john 的身份登录到 Oracle,正如预期的 john 一样,并且完全忽略了我的钱包设置。

请指教。

更新:

这是 DataSource.groovy 的其余部分

dataSource {
pooled = true
jmxExport = true
driverClassName = "oracle.jdbc.driver.OracleDriver"
username=""
password=""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
// cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
singleSession = true // configure OSIV singleSession mode
flush.mode = 'manual' // OSIV session flush mode outside of transactional context
}

// environment specific settings
environments {
development {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:oracle:oci:@//myhost:myport/myinstance"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
}
}
}

最佳答案

您应该使用带有此 format: jdbc:oracle:oci:/@alias 的网址其中 alias 是您的 tnsnames.ora 中的钱包别名文件。

此选项记录在多个位置,例如 herehere 。大多数文档都引用瘦驱动程序,但它与 OCI 驱动程序的工作方式相同。这个post描述了通过 OCI 驱动程序创建和使用钱包的完整过程

关于oracle - 带有 Oracle 厚 OCI 驱动程序的 Grails 使用错误的用户向 Oracle 进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27888535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com