如何在grails 3中配置JNDI数据源

时间:2016-02-24 08:24:14

标签: grails

当我使用grails 2.1.1时

我用它来配置jndi数据源

在config.groovy

 grails.naming.entries = [
    "jdbc/notifDS": [
        auth: "Container",
        type: "javax.sql.DataSource",
        maxActive: "50",
        maxIdle: "25",
        minIdle: "5",
        initialSize: "5",
        maxWait: "10000",
        validationQuery: "SELECT 1",
        timeBetweenEvictionRunsMillis: "60000",
        minEvictableIdleTimeMillis: "60000",
        username: "root",
        password: "root",
        driverClassName: "com.mysql.jdbc.Driver",
        url: "jdbc:mysql://localhost:3306/notif?autoReconnect=true"
    ]  

和datasource.groovy

dataSource {
            dbCreate = "update" 
            jndiName = "java:comp/env/jdbc/testJNDIDataSource"
            dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
        }

在grails 3.x.x中怎么样?

0 个答案:

没有答案