我试图创建我的第一个grails应用程序,但是我的应用程序连接到MSSQL服务器时出现了一些问题.
我的行为是(通过Windows cmd):
grails create-app hellocd hello之后我配置了dataSource文件:
dataSource {
pooled = true
jmxExport = true
driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
username = "login"
password = "password" }
environments {
development {
dataSource {
dbCreate = "update"
url = "jdbc:jtds:sqlserver:\\<server-ip>;databaseName=Grails"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:jtds:sqlserver:\\<server-ip>;databaseName=Grails"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:jtds:sqlserver:\\<server-ip>;databaseName=Grails"
}
}
}
Run Code Online (Sandbox Code Playgroud)
基础"Grails"在SQL Server中创建了alredy.
命令 grails create-domain-class Hi
然后我配置了域类Hi.groovy
class Hi {
String word …Run Code Online (Sandbox Code Playgroud)