v To install a class, using Sybase Central:
v To install a class, using Interactive SQL:
Case sensitivity of Java class data types
Example
Using classes as data types
Creating tables
using Java class
data types
1
From Sybase Central, connect to the database as a user ID with DBA
permissions.
2
Open the Java Objects folder, and double-click Add Java Class or Jar.
Follow the instructions in the wizard to install the class.
1
From Interactive SQL, connect to the database as a user ID with DBA
permissions.
2
Enter the following command to install the class:
INSTALL JAVA NEW FROM filename
$
For more information about installing classes, see the "INSTALL
statement" on page 556.
Java identifiers, including data types, are case sensitive: the Java int data
type cannot be written as INT. SQL identifiers, including data types, are case
insensitive. The int data type can also be written as Int or any other
combination of upper and lower case characters.
When a Java class is used as a SQL data type, the data type is always case
sensitive. This is an exception to the rule for SQL identifier case
insensitivity.
If you install a class named Demo, the following statements are not
equivalent:
CREATE TABLE t1 (
id INT PRIMARY KEY
demo_column Demo )
CREATE TABLE t1 (
id INT PRIMARY KEY
demo_column DEMO )
You can create a table with columns based on a Java class data type, just as
you can with any other data type. For example, if
installed into the database, you can create a table using this class as follows:
CREATE TABLE mytable (
Chapter 7 SQL Data Types
MyClass
is a Java class
291
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers