このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
(米)棚上げする/(英)提議する of Contents
Memory used by the program can be thought of as two 際立った pools: memory used for (米)棚上げする/(英)提議する data, which is not 解放(する)d unless the data is 削除するd; and memory that is 解放(する)d automatically, which 含むs memory used for (武器などの)隠匿場所ing, building result 始める,決めるs and other 内部の 操作/手術s such as 蓄える/店ing the (警察などへの)密告,告訴(状) needed for rolling 支援する a 処理/取引.
Most JVM 実施s 配分する up to a 最大限 量 of memory
(usually 64 MB by default). This 量 is 一般に not 適する when
large memory (米)棚上げする/(英)提議するs are used, or when the 普通の/平均(する) size of 列/漕ぐ/騒動s in (武器などの)隠匿場所d
(米)棚上げする/(英)提議するs is larger than a few thousand bytes. The 最大限 量 of
配分するd memory can be 始める,決める on the Java 命令(する) line that is used for
running HyperSQL. For example, the JVM parameter
-Xmx256m
増加するs the 量 to 256 MB.
The memory used for a MEMORY (米)棚上げする/(英)提議する is the sum of memory used by
each 列/漕ぐ/騒動. Each MEMORY (米)棚上げする/(英)提議する 列/漕ぐ/騒動 is a Java 反対する that 含む/封じ込めるs an array
of 反対するs for the fields in the 列/漕ぐ/騒動. Each field is an 反対する such as
Integer
, Long
,
String
, etc. In 新規加入, each 索引 on the (米)棚上げする/(英)提議する
追加するs a node 反対する. As a result, a (米)棚上げする/(英)提議する with just one column of type
INTEGER will have four 反対するs per 列/漕ぐ/騒動 taking up 80 bytes per 列/漕ぐ/騒動.
Beyond this, each extra column in the (米)棚上げする/(英)提議する 追加するs at least a few bytes to
the size of each 列/漕ぐ/騒動. TEXT (米)棚上げする/(英)提議するs use いっそう少なく memory than MEMORY (米)棚上げする/(英)提議するs, as
the array of 反対するs is read from the disk only when needed. CACHED
(米)棚上げする/(英)提議するs use even いっそう少なく memory, as discussed below.
With CACHED (米)棚上げする/(英)提議するs, the data is 蓄える/店d on disk and only up to a 最大限 number of 列/漕ぐ/騒動s are held in the memory (武器などの)隠匿場所 at any time. These (武器などの)隠匿場所d 列/漕ぐ/騒動s use the same 量 of memory per 列/漕ぐ/騒動 as MEMORY (米)棚上げする/(英)提議するs. A 選び出す/独身 memory (武器などの)隠匿場所 is used for all CACHED (米)棚上げする/(英)提議するs.
The default 最大限 number of 列/漕ぐ/騒動s in the memory (武器などの)隠匿場所 is 50,000
列/漕ぐ/騒動s. As any 無作為の subset of the 列/漕ぐ/騒動s in any of the CACHED (米)棚上げする/(英)提議するs can
be held in the (武器などの)隠匿場所, the 量 of memory needed for (武器などの)隠匿場所d 列/漕ぐ/騒動s can
reach the sum of the 列/漕ぐ/騒動s 含む/封じ込めるing the largest field data. For example
if a (米)棚上げする/(英)提議する with 100,000 列/漕ぐ/騒動s 含む/封じ込めるs 40,000 列/漕ぐ/騒動s with 1,000 bytes of
data in each 列/漕ぐ/騒動 and 60,000 列/漕ぐ/騒動s with 100 bytes in each, the (武器などの)隠匿場所 can
grow to 含む/封じ込める 50,000 of the smaller 列/漕ぐ/騒動s, but as explained below, only
10,000 or the large 列/漕ぐ/騒動s. The SET FILES CACHE ROWS
命令(する) or the hsqldb.cache_rows 関係
所有物/資産/財産 can be used to alter this 量.
The default 最大限 total size of the 列/漕ぐ/騒動s in the (武器などの)隠匿場所 is
10,000KB. This is the size of binary images of the 列/漕ぐ/騒動s and 索引s. It
translates to more actual memory, typically 2-4 times, used for the
(武器などの)隠匿場所 because the data is 代表するd by Java 反対するs. The SET
FILES CACHE SIZE
命令(する) of the
hsqldb.cache_size 関係 所有物/資産/財産 can be used
to alter this 量.
If memory is 限られた/立憲的な, the hsqldb.cache_size or hsqldb.cache_rows settings can be 減ずるd. In the example above, if the hsqldb.cache_size is 減ずるd from 10,000 to 5,000, it will 許す the number of (武器などの)隠匿場所d 列/漕ぐ/騒動s to reach 50,000 small 列/漕ぐ/騒動s, but only 5,000 of the larger 列/漕ぐ/騒動s.
Data for CLOB and BLOB columns is not (武器などの)隠匿場所d and does not 影響する/感情 the CACHED (米)棚上げする/(英)提議する memory (武器などの)隠匿場所.
The operating system usually 配分するs a large 量 of 衝撃を和らげるもの memory for 速度(を上げる) up とじ込み/提出する read 操作/手術s. Therefore, when a lot of memory is 利用できる to the operating system, all database 操作/手術s 成し遂げる faster.
By default, all the 列/漕ぐ/騒動s in the result 始める,決める are built in memory,
therefore very large result 始める,決めるs may not be possible to build with
限られた/立憲的な memory. An in-過程 database 解放(する)s
the memory when the 使用/適用 program の近くにs the
java.sql.ResultSet
反対する. A server 方式 database
解放(する)s the result 始める,決める from the server memory once the database server
has returned the result 始める,決める. A server 要求するs 付加 memory for
returning result 始める,決めるs, as it 変えるs the 十分な result 始める,決める into an array
of bytes which is then transmitted to the (弁護士の)依頼人.
In a server 方式 database, when the
setFetchSize()
method of the
java.sql.声明
interface is used to 限界 the
number of 列/漕ぐ/騒動s fetched, the whole result is held by the engine and is
returned to the JDBC ResultSet
in 封鎖するs of 列/漕ぐ/騒動s
of the 明示するd fetch size.
HyperSQL 2 supports disk-based result 始める,決めるs. The 命令(する)s,
SET SESSION RESULT MEMORY ROWS <integer>
and
SET DATABASE DEFAULT RESULT MEMORY ROWS
<integer>
明示する a threshold for the number of 列/漕ぐ/騒動s.
Results with 列/漕ぐ/騒動 counts above the threshold are 蓄える/店d on disk. These
settings also 適用する to 一時的な (米)棚上げする/(英)提議するs, 見解(をとる)s and subquery
(米)棚上げする/(英)提議するs.
Disk-based result 始める,決めるs slow 負かす/撃墜する the database 操作/手術s and should be used only when 絶対 necessary, perhaps with result 始める,決めるs that are larger than tens of thousands of 列/漕ぐ/騒動s.
When UPDATE and DELETE queries are 成し遂げるd on CACHED (米)棚上げする/(英)提議するs, the 十分な 始める,決める of 列/漕ぐ/騒動s that are 影響する/感情d, 含むing those 影響する/感情d 予定 to ON UPDATE 活動/戦闘s, is held in memory for the duration of the 操作/手術. This means it may not be possible to 成し遂げる 削除するs or updates 伴う/関わるing very large numbers of 列/漕ぐ/騒動s of CACHED (米)棚上げする/(英)提議するs with 限られた/立憲的な memory. Such 操作/手術s should be 成し遂げるd in smaller 始める,決めるs. This memory is 解放(する)d as soon as the DELETE or UPDATE is 成し遂げるd.
When 処理/取引 support is enabled with SET AUTOCOMMIT FALSE, 名簿(に載せる)/表(にあげる)s of all 挿入する, 削除する or update 操作/手術s are 蓄える/店d in memory so that they can be undone when ROLLBACK is 問題/発行するd. 処理/取引s that (期間が)わたる thousands of modifications to data will (問題を)取り上げる a lot of memory until the next COMMIT or ROLLBACK (疑いを)晴らすs the 名簿(に載せる)/表(にあげる). Each 列/漕ぐ/騒動 modification uses いっそう少なく than 100 bytes until COMMIT.
When subqueries or 見解(をとる)s are used in SELECT and other 声明s,
transient (米)棚上げする/(英)提議するs are created and 居住させるd by the engine. If the
SET SESSION RESULT MEMORY ROWS <integer>
声明 has been used, these transient (米)棚上げする/(英)提議するs are 蓄える/店d on disk when
they are larger than the threshold.
HyperSQL uses a 始める,決める of 急速な/放蕩な pools for immutable 反対するs such as
Integer, Long and short String 反対するs that are 蓄える/店d in the database.
In most circumstances, this 減ずるs the memory 足跡 still その上の
as より小数の copies of the most frequently used 反対するs are kept in memory.
The 反対する pools are 株d の中で all databases in the JVM. The size of
each pool can be 修正するd only by altering and recompiling the
org.hsqldb.蓄える/店.ValuePool
class.
接近 to 高く弓形に打ち返すs is always 成し遂げるd in chunks, so it is perfectly possible to 蓄える/店 and 接近 a CLOB or BLOB that is larger than the JVM memory 配分. The actual total size of 高く弓形に打ち返すs is almost 制限のない. We have 実験(する)d with over 100 GB of 高く弓形に打ち返すs without any loss of 業績/成果.
By default, HyperSQL 2 uses memory-based (米)棚上げする/(英)提議するs for the 高く弓形に打ち返すs schema (not the actual 高く弓形に打ち返す data). Therefore, it is practical to 蓄える/店 about 100,000 individual 高く弓形に打ち返すs in the database with the default JVM memory 配分. More 高く弓形に打ち返すs can be 蓄える/店d with larger JVM memory 配分s. ーするために 蓄える/店 millions of 高く弓形に打ち返すs with 限られた/立憲的な memory 配分, you can change the 高く弓形に打ち返す schema 貯蔵 to CACHED (米)棚上げする/(英)提議するs with the に引き続いて 声明s:
Example 12.1. Using CACHED (米)棚上げする/(英)提議するs for the LOB schema
SET TABLE SYSTEM_LOBS.BLOCKS TYPE CACHED SET TABLE SYSTEM_LOBS.LOBS TYPE CACHED SET TABLE SYSTEM_LOBS.LOB_IDS TYPE CACHED
This method of とじ込み/提出する 接近 uses the operating system's
memory-mapped とじ込み/提出する 衝撃を和らげるもの for the .data
とじ込み/提出する. For
larger databases with CACHED (米)棚上げする/(英)提議するs, use of nio 改善するs database 接近
速度(を上げる) 意味ありげに. 業績/成果 改良s can be tenfold or even
higher. By default, NIO is used for .data
とじ込み/提出するs from
16 MB up to 256 MB. You can 増加する the 限界 with the SET
FILES NIO SIZE <value>
声明. There should be enough
RAM 利用できる to 融通する the memory mapped 衝撃を和らげるものs. The memory is
not taken from the JVM memory 配分, therefore there is no need to
増加する the -Xmx parameter of the JVM. If not enough memory is
利用できる for the 明示するd value, nio is not used.
With とじ込み/提出する: databases, the engine uses the
disk for 貯蔵 of data and any change. This 含むs: the
.script
とじ込み/提出する which is always 現在の, the
.スピードを出す/記録につける
とじ込み/提出する which grows in size and is reset at 正規の/正選手
intervals, the .data
とじ込み/提出する when CACHED (米)棚上げする/(英)提議するs are
used, and the .高く弓形に打ち返すs
とじ込み/提出する when CLOB or BLOB data is
used. The .backup
とじ込み/提出する is used for 安全に by the
engine to 蓄える/店 parts of the .data
とじ込み/提出する that are
修正するd internally during 操作/手術. Both the .スピードを出す/記録につける
and .backup
とじ込み/提出するs are reset at each CHECKPOINT and a
new copy of the .script
とじ込み/提出する is written. Spare とじ込み/提出する
space, larger than the total size of the .data
and
.script
とじ込み/提出するs, 加える the 最大限 許すd size of the
.スピードを出す/記録につける
とじ込み/提出する, is needed. The .高く弓形に打ち返すs
とじ込み/提出する is not copied during database updates as it is not necessary for
safety.
When the RESULT MEMORY ROWS setting is used to 限界 the memory 列/漕ぐ/騒動s in result 始める,決めるs and 一時的な (米)棚上げする/(英)提議するs, each 開会/開廷/会期 uses 付加 disk space for large results and 一時的な (米)棚上げする/(英)提議するs. These results are 蓄える/店d in とじ込み/提出するs in the temp directory と一緒に the database とじ込み/提出するs, which are 削除するd at database shutdown.
All とじ込み/提出する: databases (except read-only
databases) 令状 the changes to the .スピードを出す/記録につける
とじ込み/提出する. There
are シナリオs where 令状ing to the .スピードを出す/記録につける
とじ込み/提出する can be
turned off to 改善する 業績/成果, 特に with larger databases used
for 一時的な data. For these 使用/適用s you can 始める,決める the 所有物/資産/財産
hsqldb.log_data=誤った to 無能にする the 回復 スピードを出す/記録につける
and 速度(を上げる) up data change 業績/成果. The 同等(の) SQL 命令(する) is SET
FILES LOG FALSE. With this setting, no data is logged, but all the
changes to (武器などの)隠匿場所d (米)棚上げする/(英)提議するs are still written to the
.data
とじ込み/提出する. To 固執する all the data changes up to
date, you can use the CHECKPOINT 命令(する). If you 成し遂げる SHUTDOWN, the
data is also 固執するd 正確に. If you do not use CHECKPOINT or
SHUTDOWN when you 終結させる the 使用/適用, all the changes are lost
and the database 逆戻りするs to its 初めの 明言する/公表する when it is opened without
losing any of the 初めの data.
This is also a useful 選択 on some 壇・綱領・公約s, such as embedded 装置s with SSD 貯蔵, as it 減ずるs 令状 操作/手術s on SSD 装置s. The lock とじ込み/提出する can also be 無能にするd with the 関係 所有物/資産/財産 hsqldb.lock_file=誤った.
Your server 使用/適用s can use a database as a 一時的な disk data (武器などの)隠匿場所 which is not 固執するd past the lifetime of the 使用/適用. For this usage, 削除する the database とじ込み/提出するs when the 使用/適用 ends.
本体,大部分/ばら積みの 挿入するs, 削除するs and updates are 成し遂げるd with the best 業績/成果 with the に引き続いて method. The database remains 安全な and 一貫した using this method. In the event of a machine 衝突,墜落 during the 操作/手術, the database can be 回復するd to the point just before the 本体,大部分/ばら積みの 操作/手術.
Before the 操作/手術, 遂行する/発効させる the SET FILES LOG FALSE 声明.
遂行する/発効させる the CHECKPOINT 声明.
成し遂げる all the 本体,大部分/ばら積みの 操作/手術s, using (製品,工事材料の)一回分d 用意が出来ている 声明s. A (製品,工事材料の)一回分 size of 1000 to 10000 is 適する. 成し遂げる commit after each (製品,工事材料の)一回分.
After all the 本体,大部分/ばら積みの 操作/手術s are 完全にする, 遂行する/発効させる the SET FILES LOG TRUE 声明.
Finally 遂行する/発効させる the CHECKPOINT 声明.
If you have 成し遂げるd many thousands of updates or 削除するs (not just 挿入するs), it is a good idea to 遂行する/発効させる CHECKPOINT DEFRAG, instead of CHECKPOINT at the end.
If things go wrong during the 本体,大部分/ばら積みの 操作/手術, for example when a unique 強制 違反 中止するs the 操作/手術, and you want to redo the whole 操作/手術, just use SHUTDOWN IMMEDIATELY instead of CHECKPOINT. When you 再開する the database it will 逆戻りする to the 明言する/公表する at the first CHECKPOINT and the 本体,大部分/ばら積みの 操作/手術 can be redone.
In all running 方式s (server or in-過程) 多重の 関係s to the database engine are supported. in-過程 (standalone) 方式 supports 関係s from the (弁護士の)依頼人 in the same Java 事実上の Machine, while server 方式s support 関係s over the 網状組織 from several different (弁護士の)依頼人s.
関係 pooling ソフトウェア can be used to connect to the database but it is not 一般に necessary. 関係 pools may be used for the に引き続いて 推論する/理由s.
To 許す new queries to be 成し遂げるd while a time-消費するing query is 存在 成し遂げるd in the background. In HyperSQL, 封鎖するing depends on the 処理/取引 支配(する)/統制する model, the 孤立/分離 level, and the 現在の activity by other 開会/開廷/会期s.
To 限界 the 最大限 number of 同時の 関係s to the database for 業績/成果 推論する/理由s. With HSQLDB this can be useful if your 使用/適用 is designed in a way that opens and の近くにs 関係s for each small 仕事. Also, the 全体にわたる 業績/成果 may be higher when より小数の 同時の 関係s are used. If you want to 減ずる the number of 同時の 開会/開廷/会期s, you can use a 関係 pool with より小数の pooled 関係s.
An 使用/適用 that is not both multi-threaded and transactional, such as an 使用/適用 for 記録,記録的な/記録するing 使用者 login and logout 活動/戦闘s, does not need more than one 関係. The 関係 can stay open 無期限に/不明確に and 再開するd only when it is dropped 予定 to 網状組織 problems.
When using an in-過程 database, when the last 関係 to the database is の近くにd, the database still remains open, waiting for the next 関係 to be made. From 見解/翻訳/版 2.2.9, each time the last 関係 is の近くにd all the data changes are logged and synched to disk.
An explicit SHUTDOWN 命令(する), with or without an argument, is 要求するd to の近くに the database. A 関係 所有物/資産/財産, shutdown=true, can be used on the 関係 URL to shutdown the database when the last 関係 is の近くにd.
When using a server database (and to some extent, an in-過程 database), care must be taken to 避ける creating and dropping JDBC 関係s too frequently. 失敗 to 観察する this will result in poor 業績/成果 when the 使用/適用 is under 激しい 負担.
A ありふれた error made by 使用者s in 負担-実験(する) 模擬実験/偽ることs is to use a 選び出す/独身 (弁護士の)依頼人 machine to open and の近くに thousands of 関係s to a HyperSQL server instance. The 関係 試みる/企てるs will fail after a few thousand because of OS 制限s on 開始 sockets and the 延期する that is built into the OS in の近くにing them.
The first thing to be aware of is the SQL conformance settings of HyperSQL. By default, HyperSQL 見解/翻訳/版 2 適用するs 厳格な人 conformance 支配するs than 見解/翻訳/版 1.8 and catches long strings or decimal values that do not fit within the 明示するd length or precision settings. However, there are several conformance settings that are turned off by default. This is to enable easier 移住 from earlier 見解/翻訳/版s, and also greater compatibility with databases such as MySQL that are いつかs very 自由主義の with type 転換s. The conformance settings are 名簿(に載せる)/表(にあげる)d in the System 管理/経営 一時期/支部 and their 関係 所有物/資産/財産 同等(の)s are 名簿(に載せる)/表(にあげる)d in the Database 所有物/資産/財産s 一時期/支部. Ideally, all the settings that are not for syntax compatibility with other databases should have a true value for best error checking. You can turn on the settings for syntax compatibility with another database if you are porting or 実験(する)ing 使用/適用s 的d at the other database.
For 使用/適用 部隊 実験(する)ing you can use an all-in-memory, in-過程 database.
If the 実験(する)s are all run in a 選び出す/独身 Java 過程, then the contents of a mem: database 生き残るs between 実験(する)s. To 解放(する) the contents, you can use the SHUTDOWN 命令(する) (an SQL 命令(する)). You can even use 多重の mem: databases in your 実験(する)s and SHUTDOWN each one 分かれて.
If the 実験(する)s are done in different Java 過程s and you want to keep the data between the 実験(する)s, the best 解答 is to use a Server instance that has a mem: database. After the 実験(する)s are done, you can SHUTDOWN this database, which will shutdown the server.
The Server has an 選択 that 許すs databases to be created as needed by making a 関係 (see the Listeners 一時期/支部). This 選択 is useful for 実験(する)ing, as your server is never shut 負かす/撃墜する when a database is shutdown. Each time you connect to the mem: database that is served by the Server, the database is created if it does not 存在する (i.e. has been 以前 shut 負かす/撃墜する).
If you do not want to run a Server instance, and you need persistence between 実験(する)s in different 過程s, then you should use a とじ込み/提出する: database. From 見解/翻訳/版 2.2.9 when the last 存在するing 関係 to the database is の近くにd, the 最新の changes to the database are 固執するd fully with fsync. The database is still in an open 明言する/公表する until it is shut 負かす/撃墜する. You can use the shutdown=true 関係 所有物/資産/財産 to の近くに the database automatically after the 関係s are の近くにd. The (a)自動的な/(n)自動拳銃 sync and shutdown are おもに for 実験(する) 環境. In 生産/産物 環境s you should 遂行する/発効させる the SHUTDOWN 声明 before your 使用/適用 is の近くにd. This 確実にするs a quick start next time you connect to the database.
An 代案/選択肢 選択 is to use hsqldb.write_delay=誤った 関係 所有物/資産/財産, but this is わずかに slower than the other 選択 and should be used in 状況/情勢s where the 実験(する) 使用/適用 does not の近くに the 関係s. This 選択 uses fsync after each commit. Even if the 実験(する) 過程 is 中止するd without shutting 負かす/撃墜する the 関係s, all committed data is saved. It has been 報告(する)/憶測d that some data 接近 枠組みs do not の近くに all their 関係 to the database after the 実験(する)s. In such 状況/情勢s, you need to use this 選択 if you want the data to 固執する at the end of the 実験(する)s
You may 現実に want to use a とじ込み/提出する:
database, or a server instance that serves a とじ込み/提出する:
database in preference to a mem: database. As
HyperSQL スピードを出す/記録につけるs the DDL and DML 声明s in the .スピードを出す/記録につける
とじ込み/提出する, this とじ込み/提出する can be used to check what is 存在 sent to the database.
公式文書,認める that UPDATE 声明s are 代表するd by a DELETE followed by an
INSERT 声明. 声明s are written out when the 関係 commits.
The 令状 延期する also has an 影響 on how soon the 声明s are written
out. By default, the 令状 延期する is 0.5 second.
The SQL logging feature in 見解/翻訳/版 2.2 and later 記録,記録的な/記録するs all 遂行する/発効させるd 声明s and can be used for debugging your 使用/適用.
Some types of 実験(する)s start with a database that already 含む/封じ込めるs the
(米)棚上げする/(英)提議するs and data, and 成し遂げる さまざまな 操作/手術s on it during the 実験(する)s.
You can create and 居住させる the 初期の database then 始める,決める the 所有物/資産/財産
files_readonly=true in the
.所有物/資産/財産s
とじ込み/提出する of the database. The 実験(する)s can then
修正する the database, but these modifications are not 固執するd after the
実験(する)s have 完全にするd and the SHUTDOWN is 遂行する/発効させるd.
Databases with files_readonly=true can be placed within the classpath and in a jar とじ込み/提出する. In this 事例/患者, the 関係 URL must use the res: 議定書, which 扱う/治療するs the database as a 資源.
Different 方式s of 操作/手術 and settings are used for different 目的s. Some シナリオs are discussed below:
In this usage, the 量 of data change is often 限られた/立憲的な and there is often a 必要物/必要条件 to 固執する the data すぐに. The default 令状 延期する of 0.5 second is 罰金 for many 使用/適用s. You can also use the 所有物/資産/財産 hsqldb.write_delay_millis=100 to 減ずる it to 0.1 second, or the 所有物/資産/財産 hsqldb.write_delay=誤った to 軍隊 a disk fsync after each commit. Before the 使用/適用 is の近くにd, you should 成し遂げる the SHUTDOWN 命令(する) to 確実にする the database is opened 即時に when it is next opened. 公式文書,認める you don't need to use SHUTDOWN COMPACT as 決まりきった仕事.
This usage 伴う/関わるs a server 使用/適用, such as a web 使用/適用, connecting to an embedded HyperSQL instance. In this usage, the database is often 接近d ひどく, therefore 業績/成果 and latency is a consideration. If the database is updated ひどく, the default value of the WRITE DELAY 所有物/資産/財産 (0.5 sec) is often enough, as it is assumed the server or the 使用/適用 does not go 負かす/撃墜する frequently. If it is necessary, you can 減ずる the WRITE DELAY to a small value (20 ms) without 衝撃ing the update 速度(を上げる). If you 減ずる WRITE DELAY to 無, 業績/成果 減少(する)s to the 速度(を上げる) of disk とじ込み/提出する sync 操作/手術.
Alternatively, a server 使用/適用 can use an all-in-memory database instance for 急速な/放蕩な 接近, while sending the data changes to a 執拗な, disk based instance either periodically or in real time.
Since you won't be able to 接近
in-過程 database instances from other
過程s, you will often want to run a Listener in your 使用/適用s
that use embedded databases. You can do this by starting up a Server or
WebServer instance programatically, but you could also use the class
org.hsqldb.util.MainInvoker
to start up your
使用/適用 and a HyperSQL Server or WebServer without any programming.
MainInvoker is a general-目的 公共事業(料金)/有用性 class to invoke the main
methods of 多重の classes. Each main class is followed by its
arguments (if any), then an empty string to separate it from the next
main class.
Example 12.2. MainInvoker Example
java -cp path/to/your/app.jar:path/to/hsqldb.jar org.hsqldb.util.MainInvoker org.hsqldb.server.Server "" com.your.main.App
(Use ; instead of : to delimit classpath elements on
Windows). The empty string separates your com.your.main.App invocation
from the org.hsqldb.server.
明示する the same in-過程 JDBC URL in
your app and in the server.所有物/資産/財産s
とじ込み/提出する. You can
then connect to the database from outside using a JDBC URL like
jdbc:hsqldb:hsql://hostname
, while connecting from
inside the 使用/適用 using something like
jdbc:hsqldb:とじ込み/提出する:<filepath of database>
.
This 手段 can be used to run off-the-shelf server 使用/適用s with an embedded HyperSQL Server, without doing any coding.
MainInvoker
can be used to run any
number of Java class main method invocations in a 選び出す/独身 JVM. See the
API spec for
org.hsqldb.util.MainInvoker
for 詳細(に述べる)s on its
usage.
HSQLDB can open databases created with 見解/翻訳/版 2.0 and above. It is a good idea to 成し遂げる SHUTDOWN COMPACT after the 昇格 to 完全にする the 昇格.
Downgrading is also possible. A database created with the 現在の 見解/翻訳/版 can be の近くにd with SHUTDOWN SCRIPT before you open it with previous 2.x 見解/翻訳/版s of HyperSQL.
To 昇格 an old database created with 見解/翻訳/版 1.8.x, you can use HSQLDB 見解/翻訳/版 2.3 to 2.5 to open the database and 成し遂げる SHUTDOWN SCRIPT. You can then open the database with 見解/翻訳/版 2.6 or later.
If the 1.8.x database script 判型 is 始める,決める to BINARY or COMPRESSED (ZIPPED), you must open the database with 見解/翻訳/版 1.8.x and 問題/発行する the SET SCRIPTFORMAT TEXT and SHUTDOWN SCRIPT 命令(する)s with the old 見解/翻訳/版, 事前の to 見解/翻訳/版 昇格.
It is 堅固に recommended to 遂行する/発効させる SHUTDOWN SCRIPT after an (a)自動的な/(n)自動拳銃 昇格 from previous 見解/翻訳/版s.
A 公式文書,認める about SHUTDOWN 方式s. SHUTDOWN COMPACT is 同等(の) to SHUTDOWN SCRIPT 加える 開始 the database and then 成し遂げるing a simple SHUTDOWN.
After 昇格ing a database, there will be some changes to its settings. For example, the new SET FILES BACKUP INCREMENT TRUE is 適用するd to 改善する the shutdown and 検問所 times of larger databases.
If your database has been created with 見解/翻訳/版 1.7.2 or 1.7.3, first 昇格 to 見解/翻訳/版 1.8.0 and 成し遂げる a SHUTDOWN SCRIPT with this 見解/翻訳/版. You can then 昇格 the database to 見解/翻訳/版 2.x.
To 昇格 from older 見解/翻訳/版 database とじ込み/提出するs (1.7.1 and older) that
含む/封じ込める CACHED (米)棚上げする/(英)提議するs, use the SCRIPT 手続き. In all 見解/翻訳/版s of
HyperSQL, the SCRIPT 'filename'
命令(する) (used as an SQL
声明) 許すs you to save a 十分な 記録,記録的な/記録する of your database, 含むing
database 反対する 鮮明度/定義s and data, to a とじ込み/提出する of your choice. You can
then use the PERFORM IMPORT ... 声明 to 負担 the とじ込み/提出する.
The *.script
とじ込み/提出する 含む/封じ込めるs SQL 声明s for
the database settings and 創造 of 反対するs such as (米)棚上げする/(英)提議するs, sequences
and 使用者-defined 機能(する)/行事. It also 含む/封じ込めるs INSERT 声明s to
居住させる MEMORY (米)棚上げする/(英)提議するs. A new copy of the *.script
とじ込み/提出する is created by the database engine at each 検問所 or shutdown.
This とじ込み/提出する is read when the database is opened. Only some types of SQL
声明s are used in this とじ込み/提出する; for example no UPDATE or DELETE
声明s are used, and the 声明s in the とじ込み/提出する follow a 確かな
sequence. Therefore, the *.script
とじ込み/提出する cannot be
edited 自由に by the 使用者 and any edits must 尊敬(する)・点 the 許容できる
判型.
In HyperSQL the 十分な 範囲 of ALTER TABLE 命令(する)s is 利用できる to
change the data structures and their 指名するs. However, if an old database
cannot be opened 予定 to data inconsistencies, or it uses 索引 or column
指名するs that are not 両立できる with 2.0, 手動式の editing of the
*.script
とじ込み/提出する can be 成し遂げるd and can be
faster.
見解/翻訳/版 2.x does not 受託する duplicate 指名するs for 索引s that were 許すd before 1.7.2.
見解/翻訳/版 2.x does not 受託する some (米)棚上げする/(英)提議する or column 指名するs that are SQL reserved keywords without 二塁打 引用するing.
見解/翻訳/版 2.x does not 受託する unquoted (米)棚上げする/(英)提議する or column 指名するs which begin with an 強調する, unless the 関係 所有物/資産/財産 sql.regular_names is 始める,決める 誤った.
見解/翻訳/版 2.x is more strict with check 条件s and default values.
Other 手動式の changes are also possible. 公式文書,認める that the
*.script
とじ込み/提出する must be the result of a SHUTDOWN SCRIPT
and must 含む/封じ込める the 十分な data for the database. The に引き続いて changes
can be 適用するd so long as they do not 影響する/感情 the 正直さ of 存在するing
data.
指名するs
指名するs of (米)棚上げする/(英)提議するs, columns and 索引s can be changed. These changes must be 一貫した regarding foreign 重要な 強制 言及/関連s.
CHECK
A check 強制 can always be 除去するd.
NOT NULL
A not-null 強制 can always be 除去するd.
PRIMARY KEY
A 最初の/主要な 重要な 強制 can be 除去するd. It cannot be 除去するd if there is a foreign 重要な 言及/関連ing the column(s).
UNIQUE
A UNIQUE 強制 can be 除去するd if there is no foreign 重要な 言及/関連ing the column(s).
FOREIGN KEY
A FOREIGN KEY 強制 can always be 除去するd.
COLUMN TYPES
Some changes to column types are possible. For example an INTEGER column can be changed to BIGINT.
INSERT 声明s
INSERT 声明s may be 追加するd to the とじ込み/提出する in the same 判型 as written by the engine.
Character Escapes
All 非,不,無-ASCII characters are escaped as Java Unicode escape sequences.
After 完全にするing the changes and saving the 修正するd
.script
とじ込み/提出する, you can open the database as
normal.
HyperSQL 2.7 適合するs to the SQL 基準 better than previous 見解/翻訳/版s and has many more features. For these 推論する/理由s, there may be some compatibility 問題/発行するs when 変えるing old database, or using 使用/適用s that were written for 見解/翻訳/版 1.8.x or earlier. Some of the 可能性のある 問題/発行するs (and enhancements) are 名簿(に載せる)/表(にあげる)d here. See the 十分な 名簿(に載せる)/表(にあげる) of 関係 所有物/資産/財産s for 代案/選択肢s.
By default, when comparing strings, the shorter string is padded
with spaces. This has an 影響 on comparing '実験(する)'
and '実験(する) '
which are now considered equal, にもかかわらず
the length difference. This behaviour is controlled by the default PAD
SPACE 所有物/資産/財産 of collations, which can be changed to NO PAD. See the
声明 SET DATABASE COLLATION <指名する> [ PAD SPACE |
NO PAD ]
.
使用者 指名するs and passwords are 事例/患者-極度の慎重さを要する. The only exception
is the 使用者 指名する 'SA' which is always 変えるd to uppercase. Check
the .script
とじ込み/提出する of a database for the 訂正する 事例/患者
of 使用者 指名する and password and use this form in the 関係
所有物/資産/財産s or on 関係 URL.
It is now possible to 明示する the admin 使用者 指名する and password for a new database (instead of SA and the empty password).
HyperSQL 2.x has several settings that relax its conformance to the SQL 基準 in the areas of type 転換 and 反対する 指名するs. These settings can be turned on for 最大限 conformance.
Check 強制s must 適合する to the SQL 基準. A check 強制 is 拒絶するd if it is not deterministic or retrospectively deterministic. When 開始 an old database, HyperSQL silently 減少(する)s check 強制s that no longer 収集する. See under check 強制s for more 詳細(に述べる) about what is not 許すd.
Type 宣言s in column 鮮明度/定義 and in cast 表現s must have the necessary size parameters.
In 関係 with the above, an old database that did not have
the enforce_strict_size
所有物/資産/財産, is now 変えるd
to 見解/翻訳/版 2.x with the engine 供給(する)ing the 行方不明の size parameters.
For example, a VARCHAR column 宣言 that has no size, is given a
32K size, a LONGVARCHAR column is given a 16MB size. Check these sizes
are 適する for your use, and change the column 鮮明度/定義 as
necessary.
Column 指名するs in a GROUP BY 条項 were 以前 解決するd to the column label. They are now 解決するd to column 指名する first, and if the 指名する does not match, to the column label.
If two or more (米)棚上げする/(英)提議するs in a join 含む/封じ込める columns with the same
指名する, the columns cannot be 言及/関連d in join and where 条件s.
Use (米)棚上げする/(英)提議する 指名するs before column 指名するs to qualify the 言及/関連s to such
columns. The SET DATABASE SQL REFERENCES { TRUE | FALSE
}
声明 enables or 無能にするs this check.
If the unqualified wild card is used, as in the 声明 SELECT * FROM ... no 付加 column 言及/関連s are 許すd. A (米)棚上げする/(英)提議する-qualified wild card 許すs 付加 column 言及/関連s in the SELECT 名簿(に載せる)/表(にあげる)
(米)棚上げする/(英)提議する 鮮明度/定義s 含む/封じ込めるing GENERATED BY DEFAULT AS
IDENTITY
but with no PRIMARY KEY
do not
automatically create a 最初の/主要な 重要な. Database
.script
とじ込み/提出するs made with 1.8 are 罰金, as the
PRIMARY KEY
条項 is always 含むd. But the
CREATE TABLE
声明s in your 使用/適用 program
may assume an (a)自動的な/(n)自動拳銃 最初の/主要な 重要な is created. The old shortcut,
IDENTITY, is 保持するd with the same meaning. So CREATE TABLE
T (ID IDENTITY, DAT VARCHAR(20))
is translated into
CREATE TABLE T(ID INTEGER GENERATED BY DEFAULT AS IDENTITY
PRIMARY KEY, DAT VARCHAR(20))
. This last form is the 訂正する
way of defining both 自動車-increment and 最初の/主要な 重要な in 見解/翻訳/版s 1.8
and 2.x.
CREATE ALIAS is now obsolete. Use the new 機能(する)/行事 鮮明度/定義
syntax. The org.hsqldb.Library
class no longer
存在するs. You should use the SQL form of the old library 機能(する)/行事s. For
example, use LOG(x)
rather than the direct form,
"org.hsqldb.Library.スピードを出す/記録につける"(x)
.
The 指名するs of some 命令(する)s for changing database and 開会/開廷/会期 所有物/資産/財産s have changed. See the 名簿(に載せる)/表(にあげる) of 声明s in this 一時期/支部.
計算するd columns in SELECT 声明s which did not have an 偽名,通称: These columns had no ResultMetaData label in 見解/翻訳/版 1.8, but in 見解/翻訳/版 2.x, the engine 生成するs labels such as C1, C2.
The 問題/発行する with the JDBC ResultSetMetaData
methods, getColumnName(int column)
and
getColumnLabel(int column)
has been 明らかにするd
by the JDBC 4 specification. getColumName()
returns the underlying column 指名する, while
getColumnLabel()
returns any 明示するd or
生成するd 偽名,通称. HyperSQL 1.8 and 2.x have a 関係 所有物/資産/財産,
get_column_name
, which defaults to true in 見解/翻訳/版
2.x, but defaulted to 誤った in some 解放(する)s of 見解/翻訳/版 1.8.x. You
have to explicitly 明示する this 所有物/資産/財産 as 誤った if you want
(非,不,無-基準 behaviour) getColumnName()
to
return the same value as
getColumnLabel()
.
HyperSQL and SqlTool 見解/翻訳/版 2.7.4 jars are Java Module jars
収集するd with JDK 11. The module 指名する for HyperSQL is
org.hsqldb
and for SqlTool,
org.hsqldb.sqltool
. In a modular 使用/適用, these
指名するs are 言及/関連d in the module-info.java
とじ込み/提出する for
the 使用者 使用/適用 that 接近s these jars.
For 非,不,無-modular 使用/適用s, the jars are 簡単に 含むd the the classpath. Jars 収集するd with JDK8 are also 供給するd and can be used for 使用/適用s that must run on a JVM older than 11.
This section is about building 使用/適用s that have dependencies upon HyperSQL, and for 死刑執行s that use a dependency library system. Examples of the second type are 部隊 実験(する) runs, 職業 runs 誘発する/引き起こすd by a build system, or systems like Grape that pull libraries from the 網状組織 at end-使用者 run time.
The best 選択 for most developers is to depend upon the 最新の
public 見解/翻訳/版 of HyperSQL with a 範囲 pattern like
[2,)
. Here are exceptional 事例/患者s where you should
depend on a static 見解/翻訳/版.
If 非,不,無 of these 状況/情勢s 適用する to you, then follow
the suggestions in the appropriate sections below. If you need to
明示する a 明確な/細部 見解/翻訳/版, follow the 指示/教授/教育s in the
範囲-見解/翻訳/版ing section but change the 見解/翻訳/版 範囲 specifications to
literal 見解/翻訳/版s like 2.7.4
.
![]() | 制限 of Maven 見解/翻訳/版 範囲 Specifiers |
---|---|
公式文書,認める that Ivy (and the many systems that use Ivy underneath,
like Grape and Gradle) supports the 開始 排除的
|
![]() | Important |
---|---|
For all examples below, when a 範囲 pattern is given, it
means the 最新の 見解/翻訳/版 equal or greater than 見解/翻訳/版
|
Example 12.3. 見本 範囲 Ivy Dependency
<dependency org="org.hsqldb" 指名する="hsqldb" rev="[2,)" conf="j8->default"/>
I give no example here of 明示するing a
classifier in ivy.xml
because I have so far failed to get that to 後継する. Classifiers in
in ivy.xml
are supported if using Gradle, as
covered below.
At the time that I'm 令状ing this, our builds are 供給するing two classifiers (besides the default no-classifier, of course) 指名するd "debug" and "jdk8". In all examples for using a classifier I am using classifier 指名する "debug".
Example 12.4. 見本 範囲 Maven Dependency
See 公式文書,認める above about Maven 範囲 specifications.
<dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <見解/翻訳/版>[2,)</見解/翻訳/版> <!-- 範囲 defaults to "収集する": <範囲>実験(する)</範囲> Use a classifier to pull one of our 代案/選択肢 jars: <classifier>debug</classifier> --> </dependency>
Example 12.5. 見本 範囲 Gradle Dependency
dependencies.収集する 'org.hsqldb:hsqldb:[2,):debug' dependencies { runtime 'org.hsqldb:hsqldb:[2,):debug@jar', 'org.hsqldb:sqltool:[2,):debug@jar' }
If you want to use an ivy.xml
とじ込み/提出する with a
Gradle build, you will need use the Ivyxml
Gradle Plugin. It just takes a few links of code in your
build.gradle
とじ込み/提出する to hook in
ivyxml
. See the
Ivyxml documentation to see 正確に/まさに how.
Example 12.6. 見本 範囲 ivy.xml 負担d by Ivyxml plugin
<ivy-module 見解/翻訳/版="2.0" xmlns:m="http://ant.apache.org/ivy/maven"> ... <dependency org="org.hsqldb" 指名する="hsqldb" rev="[2,)" m:classifier="debug"/>
$Revision: 6787 $