NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.1+)
n
Not supported for
current release
Referring to Database Objects
By default, the SQL/MP driver uses Guardian filenames for SQL/MP database objects, as the following table shows.
Default SQL/MP Database Object Names
Database
Object
Default Name * Examples
Catalog
[\node.][$volume.]subvol $sqldata.sales
\tokyo.$disk02.sqlcat
Index
[\node.][[$volume.]subvol.]fileID
emptab
$sqldisk.fy02.xsalary
\newyork.$sqldisk.fy02.salary
Table
* If you omit node, volume, or subvol, the SQL/MP driver uses your current node, volume, or subvolume to fully qualify
the database object name. For more information, see the SQL/MP Reference Manual.
If you are trying to obtain information about the SQL/MP system catalog and that catalog does not reside in the default
location ($system.sql), you must specify the following DEFINE before you start your Java application:
set defmode on
add_define =SQL_SYSTEMCAT_LOC class=map file=\$vol.subvol.catalogs
In your Java source code, you can always refer to SQL/MP database objects by their default Guardian file names. In some
cases, you can also refer to them by names that you choose (aliases). Aliases are useful when you port an application that can
be used on SQL databases having table names that do not conform to the table names used with SQL/MP.
The following subsections explain:
When you can use aliases●
How to create and use aliases●
Which SQL statements support aliases●
When You Can Use Aliases
You can use aliases for the following SQL/MP database objects:
Catalogs●
Collations●
Tables (including table qualifiers for columns)●
Views●
If an SQL/MP database object is not in the preceding list, you must refer to it by its default Guardian file name.
Creating and Using Aliases
To create and use aliases:
Create a java.util.Properties object.1.
Put each alias-Guardian file-name pair (called a substitution property) in the java.util.Properties object. Prefix
each alias with a plus sign (+). The individual put() calls for this step can be either in your program or in a separate
file.
2.