JDBC Driver for SQL/MP 3.0

// Create a java.util.Properties object named prop
java.util.Properties prop=new java.util.Properties();
// Load the file that creates the aliases
prop.load("jdbc-properties");
// Connect the program to the database, passing prop
conn = DriverManager.getConnection("jdbc:sqlmp:", prop);
// Create an SQL statement
stmt = conn.createStatement();
// Use the aliases instead of their Guardian filenames
rslt = stmt.executeQuery("select * from longname1 where col1='pickme'");
rslt = stmt.executeQuery("select * from longname2 where col1='pickme'");
Loading a Properties File Using a System Property
The JDBC driver (optionally) looks for a System property called
jdbcPropfile. If you set this System property to the
name of a file containing alias properties, the JDBC driver automatically loads that file.
This sample code uses that System property:
//Start your program specifying the System property jdbcPropfile
java -DjdbcPropfile=/h/mydir/jdbc-properties
-Djdbc.drivers=com.tandem.sqlmp.SQLMPDriver test1
//Create an SQL statement
stmt = conn.createStatement();
// Use the aliases instead of their Guardian filenames
rslt = stmt.executeQuery("select * from longname1 where col1='pickme'");
rslt = stmt.executeQuery("select * from longname2 where col1='pickme'");
Which SQL Statements Support Aliases
These SQL statements support alias substitution:
In the Data Control Language (DCL):
CONTROL TABLE
LOCK TABLE
UNLOCK TABLE
In the Data Definition Language (DDL):
ALTER CATALOG
ALTER COLLATION
ALTER INDEX
ALTER PROGRAM
ALTER TABLE
ALTER VIEW
COMMENT
CREATE CATALOG
CREATE COLLATION
CREATE CONSTRAINT
CREATE INDEX
CREATE SYSTEM CATALOG
CREATE TABLE
CREATE VIEW
DROP
HELP TEXT
UPDATE STATISTICS