如何连接到HSQLDB

如何连接到HSQLDB

问题描述:

我打算学习jdbc主题.我已经从该站点下载了HSQL DB并提取了zip文件.我有几个疑问:

Im planning to learn jdbc topic. I have downloaded the HSQL DB from the site and extracted the zip file. I have few queries:

  1. 我们如何创建新数据库?

  1. How do we create a new database?

我们将能够通过任何工具查看db的内容吗(就像在oracle中看到的一样)?

Will we be able to see the contents of the db via any tool [ just like we see in oracle ]?

如何知道他们提供的驱动程序名称是什么?

How to know what is the driver name they have supplied?

我已经检查了Web链接,但是找不到任何解决方案.请提出建议.

I have checked the weblink but could not find any solution. Please suggest.

谢谢, 帕万.

http://hsqldb.org/web/hsqlFAQ.html#NEWDB

如何创建新数据库:

如果尚不存在,则会自动创建一个新数据库.只是 使用连接到尚不存在的数据库 jdbc:hsqldb:file:«数据库路径»URL(应替换最后一部分) 用户所需的路径)以及用户"sa"(或任何名称)和一个 密码(可以是一个空字符串).您将使用此名称和密码 重新连接.

A new database is created automatically if it does not yet exist. Just connect to the not-yet-existing database using the jdbc:hsqldb:file:«database-path» URL (should replace the last part with the path you want) with the user 'sa' (or any name) and a password (can be an empty string). You will use this name and password to connect again.

问:我们可以通过任何工具查看数据库的内容吗?

Q: Will we be able to see the contents of the db via any tool?

不. SQL Server工具不适用于Oracle,mySQL工具不适用于SQL Server ...而HSQLDB的主要目标是将其与JDBC等(即程序连接)一起使用.

No. SQL Server tools aren't going to work with Oracle, mySQL tools aren't going to work with SQL Server ... and the primary goal of HSQLDB it to use it with JDBC etc, i.e. programmatic connections.

问:如何知道他们提供的驱动程序名称是什么?

Q: How to know what is the driver name they have supplied?

来自常见问题解答:

HSQLDB附带了文档,示例程序源代码可以 帮助JDBC编程新手.

HSQLDB comes with documentation, example program source code that can help programers who are new to JDBC programming.

基本示例程序位于/src/org/hsqldb/sample文件夹中.

Basic sample programs are in the /src/org/hsqldb/sample folder.

测试程序的源代码是如何使用的有用示例 JDBC和SQL的不同功能.检查来源 /src/org/hsqldb/test文件夹.

Source code of test programs are useful examples of how to use different features of JDBC and SQL. Check the sources in the /src/org/hsqldb/test folder.

SQL测试脚本位于/runtest文件夹中,并提供广泛的功能 SQL语句的示例.

SQL test scripts are in the /runtest folder and offer extensive examples of SQL statements.

HSQLDB具有标准的JDBC接口. HSQLDB特定的JDBC 文档包含在/doc/src文件夹中.

HSQLDB has a standard JDBC interface. HSQLDB specific JDBC documentation is included in the /doc/src folder.

驱动程序文件为"hsqldb.jar".

The driver file is "hsqldb.jar".