I need to set up our Grails app with AES encryption going to Oracle. In all the Java examples I have seen you create a Properties object, create an OracleDataSource and call setProperties, like so:
OracleDriver dr = new OracleDriver();
Properties prop = new Properties();
prop.setProperty( OracleConnection.CONNECTION_PROPERTY_THIN_NET_ENCRYPTION_LEVEL,AnoServices.ANO_REQUIRED);
// set more
(OracleConnection)dr.connect(url,prop);
In Grails, connections are handled by DataSource.groovy, which is a BasicDataSource, and so although you can configure properties easily with a closure like the following:
myDatasource {
pooled = false
driverClassName = "oracle.jdbc.OracleDriver"
dbCreate = "validate" // one of 'create', 'create-drop', 'update', 'validate', ''
dialect = "org.hibernate.dialect.Oracle10gDialect"
username = username
password = password
url = url
logSql = true
format_sql = true
pooled = true
properties {
maxActive = 8
maxIdle = 4
minIdle = 1
initialSize = 1
minEvictableIdleTimeMillis = 60000
timeBetweenEvictionRunsMillis = 60000
maxWait = 10000
validationQuery = "select 1 from dual"
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
}
All of the properties in that closure correspond to setters for BasicDataSource, so you can't just shove the OracleConnection properties in there.
Has anyone found a way to set up Oracle encryption for Grails? I would appreciate any help you can give
Brian