我試圖將一個新的Grails項目鏈接到預先存在的SQL Server 2008數據庫,麻煩的是當我嘗試列出/更新或者什麼都不起作用時,我得到讀取錯誤在SQL 2008遺留表格中找不到Grails表格錯誤
未找到表「TEST_EXEC_QUEUE」; SQL語句:select top 10 this_.id as id0_0_,this_.Env as Env0_0_,this_.Priority as Priority0_0_,this_.State as State0_0_,this_.subSystem as subSystem0_0_,this_.system as system0_0_,this_.test_scenario_id as test7_0_0_ from test_exec_queue this_ [42102-164]
我DataSource.groovy的文件是: -
dataSource {
pooled = false
driverClassName = "net.sourceforge.jtds.jdbc.Driver"
dialect = "org.hibernate.dialect.SQLServerDialect"
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
development {
dataSource {
dbCreate = "update"
url = "jdbc:jtds:sqlserver://UKSQL08;databaseName=Selenium"
}
}
和域文件內容如下,任何人有任何想法...?
package testexecqueue
class TestExecQueueCheck {
static constraints = {
test_scenario_id(blank:false)
myPriority()
myState()
myEnv()
system()
subSystem()
}
static mapping = {
table "test_exec_queue"
version false
columns{
test_scenario_id column:"test_scenario_id"
myPriority column:"Priority"
myState column:"State"
myEnv column:"Env"
system column:"system"
subSystem column:"subSystem"
}
}
Integer test_scenario_id
Integer myPriority
String myState
String myEnv
String system
String subSystem
}
此外,如果你想使用Windows身份驗證,你需要確保你把jdbc jar和auth dll放在lib中,我只是把問題lib文件夾中的jar文件,直到我添加了auth dll以及它開始工作,現在意味着我不需要指定用戶帳戶或密碼。 – MorkPork 2013-04-10 16:15:24