我基于this issue连接到SQL Server数据库。
driverClassName =“net.sourceforge.jtds.jdbc.Driver” dialect =“org.hibernate.dialect.SQLServerDialect” url =“jdbc:jtds:sqlserver:// myurl:1433 / mydb”
我还在buildConfig.groovy上添加了依赖项
runtime 'net.sourceforge.jtds:jtds:1.2.6'
不幸的是,控制台显示此错误:
| Error Resolve error obtaining dependencies: Could not find artifact net.sourceforge.jtds:jtds:zip:1.2.6 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Could not find artifact net.sourceforge.jtds:jtds:zip:1.2.6 in grailsCentral (http://repo.grails.org/grails/plugins)
| Run 'grails dependency-report' for further information.
答案 0 :(得分:3)
dependencies {
runtime 'net.sourceforge.jtds:jtds:1.2.6'
}
而不是
plugins{
runtime 'net.sourceforge.jtds:jtds:1.2.6'
}