`
yzgfbj
  • 浏览: 77402 次
  • 来自: ...
社区版块
存档分类
最新评论

学习hsql 内存数据库(2)

阅读更多
<二>

connection properties

get_column_name(default:true) 是否拿出column label,程序可以通过ResultSet.getColumnLabel(int column)获得

ifexists(default:false)检查数据库是否存在,如果不存在抛出异常。false的情况,如果不存在会新建一个。

shutdown(default:false) shut down the database when the last connection is closed。

Properties Files
注意大小写敏感的,必须都是小写。In 1.8.0, most of these properties can be changed via SQL commands.
有3个properties文件,前2个对应于数据库不同的运行模式。

server.properties
位置:在命令行运行Server class的文件夹中。the directory where the command to run the Server class is issued
作用:设置hsql协议相关,settings for running HSQLDB as a database server communicating with the HSQL protocol
webserver.properties
位置:同上。the directory where the command to run the WebServer class is issued
作用:设置http协议相关,settings for running HSQLDB as a database server communicating with the HTTP protocol
<dbname>.properties
位置:在具体的数据库同目录。the directory where all the files for a database are located
作用:设置每个数据库中的具体。settings for each particular database

server和webserver都有的参数
server.database.<0~9>=指定一个数据库。1.8后最多支持10数据库,可选0-9对应不同的数据库配置。
这里指定数据库可以用协议前缀,例如mem:,file:,res:等。
eg:database.0=mem:temp;sql.enforce_strict_size=true;

server.dbname.<0~9>对应于上面的数据库。设置对应的数据库别名。必须小写。

这2个参数指定hsqldb的消息输出。
server.silent(default :true) 小覆盖范围的在控制台显示hsql的消息。要显示hsql详细信息可以改为false
server.trace(default:false) 是否显示jdbc消息到控制台。

server配置独有
server.port =9001
server.no_system_exit=true 当hsqldb close时是否调用System.exit();

WebServer配置独有.webServer的一些参数可能需要好好研究WebServer的源码才可以理解。
server.port=80
server.default_page=index.html服务的默认页
server.root=./
.<extention>=?

<dbname>配置
readonly=false 数据库是否只读
hsqldb.files_readonly=false 数据库是否不写入文件
hsqldb.cache_file_scale=1 单位g。设置文件的最大限制。最大8g。
sql.enforce_size=false 去除空格padding columns。不再支持,改为sql.enforce_strict_size
sql.enforce_strict_size=false 默认直接存储值。true的情况,会自动填充空格符或格式,满足字段的定义。如char或者number数据等。
sql.tx_no_multi_rewrite=false 事务。当一个事务的内容可以更新另一个数据未提交的内容。true的话,在尝试写时会抛出异常。
hsqldb.cache_scale=14
hsqldb.cache_size_scale=10
hsqldb.log_size=200 单位m。
runtime.gc_interval=0 默认不进行定时垃圾回收。指定一个时间段,单位毫秒。
hsqldb.nio_data_file= true 用nio方法访问数据文件
hsqldb.default_table_type= memory 默认建表的类型。可选值cache
hsqldb.applog =0 应用的日志级别。默认不进行。1 会记录数据持久化中的错误信息到.app.log结尾的文件
textdb.* =0

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics