---
title: "学习hsql 内存数据库（2）"
author: "yzgfbj"
date: "2008-05-15T12:12:44Z"
tags: ["Cache", "HSQLDB", "JDBC", "SQL", "SQL Server"]
slug: "hsql-2"
draft: false
lastmod: "2008-05-15T12:12:44Z"
id: 193237
url: "https://yzgfbj.iteye.com/blog/193237"
---

&lt;二&gt; 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 .properties 位置：在具体的数据库同目录。the directory where all the files for a database are located 作用：设置每个数据库中的具体。settings for each particular database server和webserver都有的参数 server.database.&lt;0~9&gt;=指定一个数据库。1.8后最多支持10数据库，可选0-9对应不同的数据库配置。 这里指定数据库可以用协议前缀，例如mem:,file:，res:等。 eg:database.0=mem:temp;sql.enforce\_strict\_size=true; server.dbname.&lt;0~9&gt;对应于上面的数据库。设置对应的数据库别名。必须小写。 这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=./ .=? 配置 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