江西广告网
标题:
Grails中默认数据库HSQLDB点滴
[打印本页]
作者:
纸老虎
时间:
2009-2-12 09:00
标题:
Grails中默认数据库HSQLDB点滴
grails1.03中,数据库配置是这样写的: // environment specific settings environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' url = "jdbc:hsqldb:mem:devDB" } } test { dataSource { dbCreate = "update" url = "jdbc:hsqldb:mem:testDb" } } production { dataSource { dbCreate = "update" url = "jdbc:hsqldb:file:prodDb;shutdown=true" } } // environment specific settings environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' url = "jdbc:hsqldb:mem:devDB" } } test { dataSource { dbCreate = "update" url = "jdbc:hsqldb:mem:testDb" } } production { dataSource { dbCreate = "update" url = "jdbc:hsqldb:file:prodDb;shutdown=true" } }
[1] [2]
测试与开发数据默认都放在内存中运行,当服务器重启的时候,测试数据就丢失了!但是产品发布版的数据库是以文件的形式保存的! 找了半天,最后终于发现这个prodDb存放在C:\Documents and Settings\raofei中,这里的raofei是我的系统用户.找到后就简单了.定位到hsqldb-1.8.0.5.jar 所在目录,使用命令行: java -cp hsqldb-1.8.0.5.jar org.hsqldb.util.DatabaseManagerSwing java -cp hsqldb-1.8.0.5.jar org.hsqldb.util.DatabaseManagerSwing进入hsql图形管理工具,选择standalone模式,下面的url使用: view plaincopy to clipboardprint? jdbc:hsqldb:file:C:/Documents and Settings/raofei/prodDb jdbc:hsqldb:file:C:/Documents and Settings/raofei/prodDb其他默认,就可以进入
上一页 [1] [2]
欢迎光临 江西广告网 (http://bbs.jxadw.com/)
Powered by Discuz! X3.2