| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- $Id: dbproperties.xml 3626 2010-06-05 11:49:07Z fredt $ --> |
| <!DOCTYPE book [ |
| <!ENTITY % dummy22 SYSTEM "../entities/global.ent"> |
| %dummy22; |
| ]> |
| <chapter version="5.0" xml:id="dbproperties-chapt" |
| xmlns="http://docbook.org/ns/docbook" |
| xmlns:xlink="http://www.w3.org/1999/xlink" |
| xmlns:xi="http://www.w3.org/2001/XInclude" |
| xmlns:ns5="http://www.w3.org/1998/Math/MathML" |
| xmlns:ns4="http://www.w3.org/2000/svg" |
| xmlns:ns3="http://www.w3.org/1999/xhtml" |
| xmlns:ns="http://docbook.org/ns/docbook"> |
| <!-- We declare the default namespace + those for prefixes xlink: and xi: in |
| the root element, so we can use them anywhere in this file. --> |
| |
| <title xml:id="dbproperties-title">Properties</title> |
| |
| <info> |
| <authorgroup> |
| <author> |
| <personname><firstname>Fred</firstname><surname>Toussi</surname></personname> |
| |
| <affiliation> |
| <orgname>The HSQL Development Group</orgname> |
| </affiliation> |
| </author> |
| </authorgroup> |
| |
| <releaseinfo>$Revision: 3626 $</releaseinfo> |
| |
| <pubdate>$Date: 2010-06-05 07:49:07 -0400 (Sat, 05 Jun 2010) $</pubdate> |
| |
| <keywordset> |
| <keyword>Hsqldb</keyword> |
| |
| <keyword>HyperSQL</keyword> |
| |
| <keyword>SQL</keyword> |
| </keywordset> |
| |
| <legalnotice> |
| <para>Copyright 2002-2009 Fred Toussi. Permission is granted to |
| distribute this document without any alteration under the terms of the |
| HSQLDB license. Additional permission is granted to the HSQL Development |
| Group to distribute this document with or without alterations under the |
| terms of the HSQLDB license.</para> |
| </legalnotice> |
| </info> |
| |
| <section xml:id="dbproperties_connections-sect"> |
| <title>Connections</title> |
| |
| <para>The normal method of accessing a HyperSQL catalog is via the JDBC |
| Connection interface. An introduction to different methods of providing |
| database services and accessing them can be found in the <link |
| endterm="sqlgeneral-title" xlink:href="#sqlgeneral-chapt"></link> chapter. |
| Details and examples of how to connect via JDBC are provided in our |
| JavaDoc for <classname xlink:href="#JDBCConnection.html-link"> |
| JDBCConnection</classname>.</para> |
| |
| <para>A uniform method is used to distinguish between different types of |
| connection. The common driver identifier is |
| <literal>jdbc:hsqldb:</literal> followed by a protocol identifier |
| (<literal>mem: file: res: hsql: http: hsqls: https:</literal>) then |
| followed by host and port identifiers in the case of servers, then |
| followed by database identifier. Additional property / value pairs can be |
| appended to the end of the URL, separated with semicolons.</para> |
| |
| <table frame="all" pgwide="1" tocentry="1"> |
| <title>HyperSQL URL Components</title> |
| |
| <tgroup align="left" cols="3"> |
| <colspec colname="c1" /> |
| |
| <colspec colname="c2" /> |
| |
| <colspec colname="c3" /> |
| |
| <thead> |
| <row> |
| <entry>Driver and Protocol</entry> |
| |
| <entry>Host and Port</entry> |
| |
| <entry>Database</entry> |
| </row> |
| </thead> |
| |
| <tbody valign="top"> |
| <row> |
| <entry><simplelist type="vert"> |
| <member><literal>jdbc:hsqldb:mem:</literal></member> |
| </simplelist></entry> |
| |
| <entry>not available</entry> |
| |
| <entry><simplelist type="vert"> |
| <member><literal>accounts</literal></member> |
| </simplelist></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Lowercase, single-word |
| identifier creates the in-memory database when the first |
| connection is made. Subsequent use of the same Connection URL |
| connects to the existing DB.</para> <para>The old form for the |
| URL, <literal>jdbc:hsqldb:.</literal> creates or connects to the |
| same database as the new form for the URL, |
| <literal>jdbc:hsqldb:mem:.</literal></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><simplelist type="vert"> |
| <member><literal>jdbc:hsqldb:file:</literal></member> |
| </simplelist></entry> |
| |
| <entry>not available</entry> |
| |
| <entry><simplelist type="vert"> |
| <member><filename>mydb</filename></member> |
| |
| <member><filename>/opt/db/accounts</filename></member> |
| |
| <member><filename>C:/data/mydb</filename></member> |
| </simplelist></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The file path specifies the |
| database file. In the above examples the first one refers to a set |
| of mydb.* files in the directory where the |
| <literal>java</literal>command for running the application was |
| issued. The second and third examples refer to absolute paths on |
| the host machine.</para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><simplelist type="vert"> |
| <member><literal>jdbc:hsqldb:res:</literal></member> |
| </simplelist></entry> |
| |
| <entry>not available</entry> |
| |
| <entry><simplelist type="vert"> |
| <member><filename>/adirectory/dbname</filename></member> |
| </simplelist></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1">Database files can be loaded from |
| one of the jars specified as part of the <literal>Java</literal> |
| command the same way as resource files are accessed in Java |
| programs. The <literal>/adirectory</literal> above stands for a |
| directory in one of the jars.</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><simplelist type="vert"> |
| <member><literal>jdbc:hsqldb:hsql:</literal></member> |
| |
| <member><literal>jdbc:hsqldb:hsqls:</literal></member> |
| |
| <member><literal>jdbc:hsqldb:http:</literal></member> |
| |
| <member><literal>jdbc:hsqldb:https:</literal></member> |
| </simplelist></entry> |
| |
| <entry><simplelist type="vert"> |
| <member><literal>//localhost</literal></member> |
| |
| <member><literal>//192.0.0.10:9500</literal></member> |
| |
| <member><literal>//dbserver.somedomain.com</literal></member> |
| </simplelist></entry> |
| |
| <entry><simplelist type="vert"> |
| <member><literal>/an_alias</literal></member> |
| |
| <member><literal>/enrollments</literal></member> |
| |
| <member><literal>/quickdb</literal></member> |
| </simplelist></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The host and port specify |
| the IP address or host name of the server and an optional port |
| number. The database to connect to is specified by an alias. This |
| alias is a lowercase string defined in the |
| <filename>server.properties</filename> file to refer to an actual |
| database on the file system of the server or a transient, |
| in-memory database on the server. The following example lines in |
| <filename>server.properties</filename> or |
| <filename>webserver.properties</filename> define the database |
| aliases listed above and accessible to clients to refer to |
| different file and in-memory databases.</para> <para>The old form |
| for the server URL, e.g., |
| <literal>jdbc:hsqldb:hsql//localhost</literal> connects to the |
| same database as the new form for the URL, |
| <literal>jdbc:hsqldb:hsql//localhost/</literal> where the alias is |
| a zero length string.</para></entry> |
| </row> |
| </tbody> |
| </tgroup> |
| </table> |
| |
| <section xml:id="conn_props-sect"> |
| <title>Connection properties</title> |
| |
| <para>Each JDBC Connection to a database can specify connection |
| properties. The properties <property>user</property> and |
| <property>password</property> are always required. In 2.0 the following |
| optional properties can also be used.</para> |
| |
| <para>Connection properties are specified either by establishing the |
| connection via the method call below, or the property can be appended to |
| the full Connection URL.</para> |
| |
| <programlisting> DriverManager.getConnection (String url, Properties info);</programlisting> |
| |
| <table frame="all" pgwide="1" tocentry="1"> |
| <title>Connection Properties</title> |
| |
| <tgroup align="left" cols="3"> |
| <colspec colname="c1" colwidth="7cm" /> |
| |
| <colspec colname="c2" colwidth="1.5cm" /> |
| |
| <colspec colname="c3" /> |
| |
| <tbody valign="top"> |
| <row> |
| <entry><property>get_column_name</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>column name in ResultSet</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property is used for |
| compatibility with other JDBC driver implementations. When true |
| (the default), <methodname>ResultSet.getColumnName(int |
| c)</methodname> returns the underlying column name. This |
| property can be specified differently for different connections |
| to the same database.</para><para>The default is true. When the |
| property is false, the above method returns the same value as |
| <methodname>ResultSet.getColumnLabel(int column)</methodname> |
| Example below:</para><programlisting> jdbc:hsqldb:hsql://localhost/enrollments;get_column_name=false</programlisting><para>When |
| a ResultSet is used inside a user-defined stored procedure, the |
| default, true, is always used for this property.</para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>ifexists</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>connect only if database already exists</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Has an effect only with |
| <glossterm>mem:</glossterm> and <glossterm>file:</glossterm> |
| database. When true, will not create a new database if one does |
| not already exist for the URL.</para><para>When the property is |
| false (the default), a new <glossterm>mem:</glossterm> or |
| <glossterm>file:</glossterm> database will be created if it does |
| not exist.</para> <para>Setting the property to true is useful |
| when troubleshooting as no database is created if the URL is |
| malformed. Example below:</para> <programlisting> jdbc:hsqldb:file:enrollments;ifexists=true</programlisting></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>shutdown</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>shut down the database when the last connection is |
| closed</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>If this property is |
| <literal>true</literal>, when the last connection to a database |
| is closed, the database is automatically shut down. The property |
| takes effect only when the first connection is made to the |
| database. This means the connection that opens the database. It |
| has no effect if used with subsequent connections.</para> |
| <para>This command has two uses. One is for test suites, where |
| connections to the database are made from one JVM context, |
| immediately followed by another context. The other use is for |
| applications where it is not easy to configure the environment |
| to shutdown the database. Examples reported by users include web |
| application servers, where the closing of the last connection |
| coincides with the web app being shut |
| down.</para><programlisting> jdbc:hsqldb:file:enrollments;shutdown=true</programlisting></entry> |
| </row> |
| </tbody> |
| </tgroup> |
| </table> |
| |
| <para>In addition, when a connection to an |
| <glossterm>in-process</glossterm> database creates a new database, or |
| opens an existing database (i.e. it is the first connection made to the |
| database by the application), all the user-defined database properties |
| can be specified as URL properties. This can be used to specify |
| properties to enforce more strict SQL adherence, or to change |
| cache_scale or similar properties before the database files are created. |
| However, for new databases, it is recommended to use the SET PROPERTY |
| command for such settings.</para> |
| </section> |
| </section> |
| |
| <section> |
| <title>Database Properties in Connection URL and Properties</title> |
| |
| <para>The database engine has several properties that are listed in the |
| <link endterm="deployment-title" xlink:href="#deployment-chapt"></link> |
| chapter. These properties can be changed via SQL commands after a |
| connection is made to the database. It is possible to specify all of these |
| properties in the connection properties on as part of the URL string when |
| the first connection is made to a new file: or mem: database. This allows |
| the properties to be set without using any SQL commands. The corresponding |
| SQL command is given for each property.</para> |
| |
| <para>Management of properties has changed since version 1.8. The old SET |
| PROPERTY does not change a property and is retained to simplify |
| application upgrades.</para> |
| |
| <para>In the example URL below, two properties are set for the first |
| connection to a new database. If the properties are used for connection to |
| an existing database, they are ignored.</para> |
| |
| <programlisting> jdbc:hsqldb:file:enrollments;hsqldb.cache_rows=10000;hsqldb.nio_data_file=false</programlisting> |
| |
| <para>In the table below, database properties that can be used as part of |
| the URL below are given. For each property that can also be set with an |
| SQL statement, the statement is also given. These statements are described |
| in the <link endterm="deployment-title" |
| xlink:href="#deployment-chapt"></link> chapter.</para> |
| |
| <table frame="all" pgwide="1" tocentry="1"> |
| <title>Database-specific Property File Properties</title> |
| |
| <tgroup align="left" cols="3"> |
| <colspec colname="c1" colwidth="6.5cm" /> |
| |
| <colspec colname="c2" colwidth="1.5cm" /> |
| |
| <colspec colname="c3" /> |
| |
| <thead> |
| <row> |
| <entry>Value</entry> |
| |
| <entry>Default</entry> |
| |
| <entry>Description</entry> |
| </row> |
| </thead> |
| |
| <tbody valign="top"> |
| <row> |
| <entry><property>check_props</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>checks the validity of the connection properties</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>If the property is true, |
| every database property that is specified on the URL or in |
| connection properties is checked and if it is not used correctly, |
| an error is returned</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>crypt_lobs</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>encryption of lobs</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>If the property is true, the |
| contents of the .lobs file is encrypted as |
| well.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>crypt_key</property></entry> |
| |
| <entry><literal>none</literal></entry> |
| |
| <entry>encryption</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The cipher key for an |
| encrypted database</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>crypt_provider</property></entry> |
| |
| <entry><literal>none</literal></entry> |
| |
| <entry>encryption</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The fully-qualified class |
| name of the cryptography provider. This property is not used for |
| the default security provider.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>crypt_type</property></entry> |
| |
| <entry><literal>none</literal></entry> |
| |
| <entry>encryption</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The cipher |
| specification.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>read_only</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>readonly database</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property is a special |
| property that can be added manually to the .properties file, or |
| included in the URL or connection properties. When this property |
| is true, the database becomes |
| readonly.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry><property>files_read_only</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>readonly files database</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property is used |
| similarly to the hsqldb.read_only property. When this property is |
| true, CACHED and TEXT tables are readonly but memory files are |
| not. Any change to the data is not persisted to database |
| files.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.log_data</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>recovery log</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property can be set to |
| false when database recovery in the event of an unexpected crash |
| is not necessary. A database that is used as a temporary cache is |
| an example. Regardless of the value of this property, if there is |
| a proper shutdown of the database, all the change data is |
| stored.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>sql.enforce_names</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>enforcing SQL keywords</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property, when set |
| true, prevents SQL keywords being used for database object names |
| such as columns and tables.</para><para><programlisting>SET DATABASE SQL NAMES { TRUE | FALSE }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>sql.enforce_size</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>trimming and padding string columns.</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property is the same as |
| sql.enforce_strict_size</para></entry> |
| </row> |
| |
| <row> |
| <entry><property>sql.enforce_strict_size</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>size enforcement and padding string columns</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Conforms to SQL standards |
| for size and precision of data types. When true, all CHARACTER, |
| VARCHAR, NUMERIC and DECIMAL values that are in a row affected by |
| an INSERT INTO or UPDATE statement are checked against the size |
| specified in the SQL table definition. An exception is thrown if |
| the value is too long. Also all CHARACTER values that are shorter |
| than the specified size are padded with |
| spaces.</para><para><programlisting>SET DATABASE SQL SIZE { TRUE | FALSE }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>sql.enforce_refs</property></entry> |
| |
| <entry><literal>false</literal></entry> |
| |
| <entry>enforcing column reference disambiguation</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This property, when set |
| true, causes an error when an SQL statements contains column |
| references that can be resovled by more than one table name or |
| alias. In effect forces such column references to have a table |
| name or table alias qualifier.</para><para><programlisting>SET DATABASE SQL REFERENCES { TRUE | FALSE }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>runtime.gc_interval</property></entry> |
| |
| <entry><literal>0</literal></entry> |
| |
| <entry>forced garbage collection</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>This setting forces garbage |
| collection each time a set number of result set row or cache row |
| objects are created. The default, "0" means no garbage collection |
| is forced by the program.</para><para><programlisting>SET DATABASE GC <numeric value></programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.default_table_type</property></entry> |
| |
| <entry><literal>memory</literal></entry> |
| |
| <entry>type of table created with unqualified CREATE TABLE</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The CREATE TABLE command |
| results in a MEMORY table by default. Setting the value |
| <emphasis>cached</emphasis> for this property will result in a |
| cached table by default. The qualified forms such as CREATE MEMORY |
| TABLE or CREATE CACHED TABLE are not affected at all by this |
| property.</para><para><programlisting>SET DATABASE DEFAULT TABLE TYPE { CACHED | MEMORY }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.applog</property></entry> |
| |
| <entry><literal>0</literal></entry> |
| |
| <entry>application logging level</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The default level 0 |
| indicates no logging. Level 1 results in events related to |
| persistence to be logged, including any failures. Level 2 |
| indicates all events, including ordinary events. The events are |
| logged in a file ending with |
| ".app.log".</para><para><programlisting>SET DATABASE EVENT LOG LEVEL { 0 | 1 | 2 }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.result_max_memory_rows</property></entry> |
| |
| <entry><literal>0</literal></entry> |
| |
| <entry>amount of result rows that are kept in memory</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Sets the maximum number of |
| rows of each result set and other internal temporary table that is |
| held in memory. </para><para><programlisting>SET DATABASE DEFAULT RESULT MEMORY ROWS <unsigned integer literal></programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.tx</property></entry> |
| |
| <entry><literal>locks</literal></entry> |
| |
| <entry>database transaction control mode</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Indicates the transaction |
| control mode for the database. The values, locks, mvlocks and mvcc |
| are allowed.</para><para><programlisting>SET DATABASE TRANSACTION CONTROL { LOCKS | MVLOCKS | MVCC }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.cache_rows</property></entry> |
| |
| <entry><literal>50000</literal></entry> |
| |
| <entry>maximum number of rows in memory cache</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Indicates the maximum number |
| of rows of cached tables that are held in memory.</para><para>The |
| value can range between 100-1,000,000. If the value is set via SET |
| FILES then it becomes effective after the next database SHUTDOWN |
| or CHECKPOINT.</para><para>The property is changed via the |
| <literal>SET FILES CACHE ROWS nnn</literal> SQL |
| command.</para><para><programlisting>SET FILES CACHE ROWS <numeric value></programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.cache_size</property></entry> |
| |
| <entry><literal>10000</literal></entry> |
| |
| <entry>memory cache size</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Indicates the total size (in |
| kilobytes) of rows in the memory cache used with cached tables. |
| This size is calculated as the binary size of the rows, for |
| example an INTEGER is 4 bytes. The actual memory size used by the |
| objects is 2 to 4 times this value. This depends on the types of |
| objects in database rows, for example with binary objects the |
| factor is less than 2, with character strings, the factor is just |
| over 2 and with date and timestamp objects the factor is over |
| 3.</para><para>The value can range between 100-1,000,000. The |
| default is 10,000, representing 10,000 kilobytes. If the value is |
| set via SET FILES then it becomes effective after the next |
| database SHUTDOWN or CHECKPOINT.</para><para><programlisting>SET FILES CACHE SIZE <numeric value></programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.inc_backup</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>incremental backup of data file</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>During updates, the contents |
| of the .data file are modified. When this property is true, the |
| modified contents are backed up gradually. This causes a marginal |
| slowdown in operations, but allows fast checkpoint and |
| shutdown.</para><para>When the property is false, the .data file |
| is backed up entirely at the time of checkpoint and shutdown. Up |
| to version 1.8, HSQLDB supported only full |
| backup.</para><para><programlisting>SET FILES INCREMENT BACKUP { TRUE | FALSE }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.lock_file</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>use of lock file</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>By default, a lock file is |
| created for each file database that is opened for read and write. |
| This property can be specified with the value false to prevent the |
| lock file from being created. This usage is not recommended but |
| may be desirable when flash type storage is |
| used.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.log_data</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>logging data change</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>When |
| <literal>false</literal> is specified, no data logging takes |
| place. A checkpoint or shutdown still rewrites the |
| <literal>.script</literal> file and saves the |
| <literal>.backup</literal> file according to the other |
| settings.</para><para><programlisting>SET FILES LOG { TRUE | FALSE }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.log_size</property></entry> |
| |
| <entry><literal>50</literal></entry> |
| |
| <entry>size of log when checkpoint is performed</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>The value is the size (in |
| megabytes) that the <literal>.log</literal> file can reach before |
| an automatic checkpoint occurs. A checkpoint rewrites the |
| <literal>.script</literal> file and clears the |
| <literal>.log</literal> file.</para><para><programlisting>SET FILES LOG SIZE <numeric value></programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.nio_data_file</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>use of nio access methods for the .data file</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>When HyperSQL is compiled |
| and run in Java 1.4 or higher, setting this property to |
| <literal>false</literal> will avoid the use of nio access methods, |
| resulting in somewhat reduced speed. If the data file is larger |
| than 256MB when it is first opened, nio access methods are not |
| used. Also, if the file gets larger than the amount of available |
| computer memory that needs to be allocated for nio access, non-nio |
| access methods are used.</para><para>If used before defining any |
| CACHED table, it applies immediately, otherwise it comes into |
| effect after a SHUTDOWN and restart or |
| CHECKPOINT.</para><para><programlisting>SET FILES NIO { TRUE | FALSE }</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.translate_dti_types</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>usage of type codes for advanced type datetime |
| types</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>If the property is true, the |
| datetime WITH TIME ZONE types and INTERVAL types are represented |
| as JDBC datetime types without time zone and the VARCHAR type |
| respectively.</para><para><programlisting>this property cannot be set with an SQL statement</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.write_delay</property></entry> |
| |
| <entry><literal>true</literal></entry> |
| |
| <entry>write delay for writing log file entries</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>If the property is true, the |
| default WRITE DELAY property of the database is used, which is |
| 1000 milliseconds. If the property is false, the WRITE DELAY is |
| set to 0 seconds. The SQL command for this property allows more |
| precise control over the property.</para><para><programlisting>SET FILES WRITE DELAY {{ TRUE | FALSE } | <seconds value> | <milliseconds value> MILLIS</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>hsqldb.write_delay_millis</property></entry> |
| |
| <entry><literal>1000</literal></entry> |
| |
| <entry>write delay for writing log file entries</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>If the property is used, the |
| WRITE DELAY property of the database is set the given value. The |
| SQL command for this property allows the same level of control |
| over the property.</para><para><programlisting>SET FILES WRITE DELAY {{ TRUE | FALSE } | <seconds value> | <milliseconds value> MILLIS</programlisting></para></entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"></entry> |
| </row> |
| |
| <row> |
| <entry><property>textdb.*</property></entry> |
| |
| <entry><literal>0</literal></entry> |
| |
| <entry>default properties for new text tables</entry> |
| </row> |
| |
| <row> |
| <entry nameend="c3" namest="c1"><para>Properties that override the |
| database engine defaults for newly created text tables. Settings |
| in the text table <literal>SET <tablename> SOURCE <source |
| string> </literal>command override both the engine defaults and |
| the database properties defaults. Individual |
| <property>textdb.*</property> properties are listed in the <link |
| endterm="texttables-title" xlink:href="#texttables-chapt"></link> |
| chapter.</para></entry> |
| </row> |
| </tbody> |
| </tgroup> |
| </table> |
| |
| <para>When connecting to an <glossterm>in-process</glossterm> database |
| creates a new database, or opens an existing database (i.e. it is the |
| first connection made to the database by the application), all the |
| user-defined database properties listed in this section can be specified |
| as URL properties.</para> |
| |
| <simpara>When HSQLDB is used in OpenOffice.org, some property values will |
| have a different default. The properties and values are:</simpara> |
| |
| <simpara>hsqldb.default_table_type=cached hsqldb.cache_rows=25000; |
| hsqldb.cache_size=6000; hsqldb.log_size=10; hsqldb.nio_data_file=false; |
| sql.enforce_strict_size=true</simpara> |
| </section> |
| </chapter> |