JDBC 连接

指定访问 JDBC 数据库的选项。

JDBC 示例

可以使用 JDBC 驱动程序类连接到 LibreOffice 的 JDBC 数据库。驱动程序类由数据库制造商提供。JDBC 数据库的两个示例是 Oracle 和 MySQL。

批注图标 您必须在 ” - LibreOffice - 高级“ 中将驱动的 class 添加到 LibreOffice。

Oracle 数据库

可以使用 JDBC 驱动程序从 Solaris 或 Linux 访问 Oracle 数据库。要从 Windows 访问该数据库,需要使用 ODBC 驱动程序。

数据源 URL 框中,输入 Oracle 数据库服务器的位置。URL 的语法取决于数据库的类型。有关详细信息,请参阅 JDBC 驱动程序附带的文档。

对于 Oracle 数据库,URL 的语法是:

oracle:thin:@hostname:port:database_name

MySQL 数据库

MySQL 数据库的驱动程序可在 MySQL 站点上获取。

MySQL 数据库的语法是:

mysql://hostname:port/database_name

数据源 URL

Enter the URL for the database. For example, for the MySQL JDBC driver, enter "jdbc:mysql://<Servername>/<name of the database>". For more information on the JDBC driver, consult the documentation that came with the driver.

JDBC 驱动程序类

Enter the name of the JDBC driver.

警告图标 在使用 JDBC 驱动之前,您需要添加其class路径。选择 - LibreOffice- 高级,然后单击 Class 路径 按钮。添加了路径信息后,重启 LibreOffice

测试类

使用当前设置测试连接。

验证

数据库向导