此内容没有您所选择的语言版本。

16.2. Installing JDBC Drivers


To use the selected external database, you must also install the JDBC driver for your database. The JDBC driver is a JAR file, which must be placed into the <JBOSS_HOME>/server/<PROFILE>/lib directory. Replace <PROFILE> with the server profile you are using.
This file is loaded when JBoss Enterprise Application Platform starts up, so if you have the JBoss Enterprise Application Platform running, you will need to shut down and restart. Review the list below for a suitable JDBC driver. For a full list of certified JBoss Enterprise Application Platform database drivers, refer to http://www.jboss.com/products/platforms/application/supportedconfigurations/#JEAP5-0. If the links fail to work, please file a JIRA against this documentation, but be aware that Red Hat does not control these external links. Contact your database vendor for the most current version of the driver for your database.

JBDC Driver Download Locations

MySQL
PostgreSQL
Oracle
IBM
Sybase
Download from the Sybase jConnect product page http://www.sybase.com/products/allproductsa-z/softwaredeveloperkit/jconnect.

Note

When using Sybase database with this driver, the MaxParams attribute cannot be set higher than 481 due to a limitation in the driver's PreparedStatement class.
Microsoft
Download from the MSDN web site http://msdn.microsoft.com/data/jdbc/.

16.2.1. Special Notes on Sybase

Some of the services in JBoss uses null values for the default tables that are created. Sybase Adaptive Server should be configured to allow nulls by default.
sp_dboption db_name, "allow nulls by default", true
Copy to Clipboard Toggle word wrap
Refer to the Sybase manuals for more options.
Additionally, text and image values stored in the database can be very large. When a select list includes both text and image values, the length limit of the data returned is determined by the @@textsize global variable. The default setting for this variable depends on the software used to access Adaptive Server. For the JDBC driver, the default value is 32 kilobytes.

16.2.1.1. Enable JAVA services

To use any Java service (for example; JMS, CMP, timers) configured with Sybase, Java must be enabled on Sybase Adaptive Server. To do this use:
sp_configure "enable java",1
Copy to Clipboard Toggle word wrap
Refer to the sybase manuals for more information.
If Java is not enabled for Sybase Adaptive Server, the following error message may be echoed in the console.
com.sybase.jdbc2.jdbc.SybSQLException: Cannot run this command because Java services are not
        enabled. A user with System Administrator (SA) role must reconfigure the system to enable Java
Copy to Clipboard Toggle word wrap

16.2.1.2. CMP Configuration

To use Container Managed Persistence for user defined Java objects with Sybase Adaptive Server Enterprise, the Java classes should be installed in the database. The system table sysxtypes contains one row for each extended Java-SQL datatype. This table is only used for Adaptive Servers enabled for Java. Install Java classes using the installjava program.
installjava -f <jar-file-name> -S<sybase-server> -U<super-user> -P<super-pass> -D<db-name>
Copy to Clipboard Toggle word wrap
Refer to the installjava manual in Sybase for more options.

16.2.1.3. Installing Java Classes

  1. You have to be a super-user with required privileges to install Java classes.
  2. The JAR file you are trying to install should be created without compression.
  3. Java classes that you install and use in the server must be compiled with JDK 1.2.2. If you compile a class with a later JDK, you will be able to install it in the server using the installjava utility, but you will get a java.lang.ClassFormatError exception when you attempt to use the class. This is because Sybase Adaptive Server uses an older JVM internally, and requires the Java classes to be compiled with the same.

16.2.1.4. Increase @@textsize Default for Sybase v15.0.3

A problem with the default maximum text size value returned from the database may cause some tests to fail on JBoss Messaging. To correct the issue, change the default @@textsize value from 32768 (bytes) to 2147483647 (bytes).
Make the change in the sybase-ds.xml file inside a <connection-url> directive. An example sybase-ds.xml file is located in <JBOSS_HOME>/jboss-as/docs/examples/jca/

Important

Specify the entire URL to the database as the directive value. Replace [domain] with the domain name or IP address hosting the Sybase Database, and [port] with the port configured to accept requests.
<connection-url>jdbc:sybase:[domain]:[port]/db_name?SQLINITSTRING=set TextSize 2147483647</connection-url>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat