JDBC 连接
指定访问 JDBC 数据库的选项。
JDBC 示例
可以使用 JDBC 驱动程序类连接到 LibreOffice 的 JDBC 数据库。驱动程序类由数据库制造商提供。JDBC 数据库的两个示例是 Oracle 和 MySQL。
您必须在 ”LibreOffice - 首选项工具 - 选项 - LibreOffice - 高级“ 中将驱动的 class 添加到 LibreOffice。 |
Oracle 数据库
可以使用 JDBC 驱动程序从 Solaris 或 Linux 访问 Oracle 数据库。要从 Windows 访问该数据库,需要使用 ODBC 驱动程序。
On UNIX, ensure that the Oracle database client is installed with JDBC support. The JDBC driver class for the Solaris Oracle client version 8.x is located in the <Oracle client>/product/jdbc/lib/classes111.zip directory. You can also download the latest version from the Oracle web site.
在数据源 URL 框中,输入 Oracle 数据库服务器的位置。URL 的语法取决于数据库的类型。有关详细信息,请参阅 JDBC 驱动程序附带的文档。
对于 Oracle 数据库,URL 的语法是:
oracle:thin:@hostname:port:database_name
-
hostname 是运行 Oracle 数据库的计算机的名称。您也可以用服务器的 IP 地址替换主机名称。
-
port 是 Oracle 数据库侦听的端口。请向数据库管理员咨询正确的端口地址。
-
database_name 是 Oracle 数据库的名称。请向数据库管理员咨询正确的名称。
MySQL 数据库
MySQL 数据库的驱动程序可在 MySQL 站点上获取。
MySQL 数据库的语法是:
mysql://hostname:port/database_name
-
hostname 是运行 MySQL 数据库的计算机的名称。您也可以用服务器的 IP 地址替换主机名称。
-
port 是 MySQL 数据库的默认端口 3306。
-
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 - 首选项工具 - 选项 - LibreOffice- 高级,然后单击 Class 路径 按钮。添加了路径信息后,重启 LibreOffice。 |
测试类
使用当前设置测试连接。