I'm trying to connect to multiple data sources by a grails application. What I tried worked in a development environment correctly. Initially there was a timestamp error which got resolved with 'zeroDateTimeBehavior=convertToNull
' adding to a url. But now in production environment, I don't understand how to add this variable.
My development environment code is,
dataSource_test {
driverClassName = "com.mysql.jdbc.Driver"
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
dbCreate = "validate" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:mysql://localhost/test?useUnicode=yes&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull"
username = "root"
password = "root"
}
And my production environment code is
dataSource_test{
dbCreate = "validate"
jndiName = "java:comp/env/jdbc/test"
}
I've also added this datasource to jetty.xml as following,
<New id="DS" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg><Ref refid="Server"/></Arg>
<Arg>jdbc/test</Arg>
<Arg>
<New class="com.zaxxer.hikari.HikariDataSource">
<Arg>
<New class="com.zaxxer.hikari.HikariConfig">
<Set name="minimumIdle"><Property name="db.min.conn" /></Set>
<Set name="maximumPoolSize"><Property name="db.max.conn" /></Set>
<Set name="dataSourceClassName">com.mysql.jdbc.jdbc2.optional.MysqlDataSource</Set>
<Set name="username"><Property name="db.user" /></Set>
<Set name="password"><Property name="db.pass" /></Set>
<Call name="addDataSourceProperty">
<Arg>url</Arg>
<Arg>jdbc:mysql://<Property name="db.host" />/test</Arg>
</Call>
<Set name="leakDetectionThreshold">30000</Set>
</New>
</Arg>
</New>
</Arg>
</New>
I don't understand where should I put "zeroDateTimeBehavior=convertToNull
" ?