ALTER DATABASE Statement

Upgrades a database created with a previous version of the software or adds or removes Java or jConnect™ for JDBC™ support. Run this statement with Interactive SQL (dbisql).

See SQL Anywhere 11.0.1 > SQL Anywhere Server – Programming > Java in the database > Java support in SQL Anywhere > Introduction to Java support.

Syntax

ALTER DATABASE UPGRADEJAVAON | OFF } ]
    [ JCONNECT { ON | OFF } ]

Examples

Usage

The ALTER DATABASE statement upgrades databases created with earlier versions of the software. This applies to maintenance releases as well as major releases.

When you upgrade a database, Sybase IQ makes these changes:
  • Upgrades the system tables to the current version.

  • Adds any new database options.

  • Enables new features in the current version.

You can also use ALTER DATABASE UPGRADE simply to add Java or jConnect features, if the database was created with the current version of the software.

Note:
  • See the Installation and Configuration Guide for backup recommendations before you upgrade.
  • Be sure to start the server in a way that restricts user connections before you run ALTER DATABASE UPGRADE. For instructions and other upgrade caveats, see Installation and Configuration Guide > Database Upgrades for your platform.
  • Use the iqunload utility to upgrade databases created in versions earlier than 15.0. See Installation and Configuration Guide > Database Upgrades for your platform.

After using ALTER DATABASE UPGRADE, shut down the database.

JAVA clause— Controls support for Java in the upgraded database.
  • Specify JAVA ON to enable support for Java in the database by adding entries for the default Sybase runtime Java classes to the system tables. If Java in the database is already installed, but is at a lower version than the default classes, this clause upgrades it to the current default classes. The default classes are the JDK 1.3 classes.

  • Specify JAVA OFF to prevent the addition of Java in the database to databases that do not already have it installed. For databases that already have Java installed, setting JAVA OFF does not remove Java support: the version of Java remains at the current version.

  • The default behavior is JAVA OFF.

  • To use Java after adding it in the database, you must restart the database.

  • Java support is external to the database. Upgrade or change the version of the Java Development Kit (JDK)/Java Runtime Environment (JRE) installed on your system to change the version of Java used by Sybase IQ.

  • For more information on Java support, see SQL Anywhere 11.0.1 > SQL Anywhere Server – Programming > Java in the database > Java support in SQL Anywhere > Introduction to Java support.

JCONNECT clause— To allow the Sybase jConnect JDBC driver to access system catalog information, you must specify JCONNECT ON. This installs jConnect system tables and procedures. To exclude the jConnect system objects, specify JCONNECT OFF. You can still use JDBC, as long as you do not access system catalog information. The default is to include jConnect support (JCONNECT ON).

Side effects:
  • Automatic commit

Standards

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise.

Permissions

Must have DBA authority.

Related reference
CREATE DATABASE Statement