|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.catalog.SystemProcedures
public class SystemProcedures
Some system built-in procedures, and help routines. Now used for network server. These procedures are built-in to the SYSIBM schema which match the DB2 SYSIBM procedures. Currently information on those can be found at url: ftp://ftp.software.ibm.com/ps/products/db2/info/vr8/pdf/letter/db2l2e80.pdf
Also used for builtin-routines, such as SYSFUN functions, when direct calls into Java libraries cannot be made.
Field Summary | |
---|---|
private static java.lang.String |
DRIVER_TYPE_OPTION
|
private static double |
LOG10
Constant for natural log(10). |
private static java.lang.String |
ODBC_DRIVER_OPTION
|
private static int |
SQL_BEST_ROWID
|
private static int |
SQL_ROWVER
|
static java.lang.String |
SQLERRMC_MESSAGE_DELIMITER
SQLERRMC_MESSAGE_DELIMITER When message argument tokes are sent,
this value separates the tokens for mulitiple error messages |
Constructor Summary | |
---|---|
SystemProcedures()
|
Method Summary | |
---|---|
private static void |
checkJarSQLName(java.lang.String sqlName)
|
static double |
COSH(double value)
Hyperbolic Cosine function. |
static double |
COT(double value)
Cotangent function. |
private static void |
createXplainSchema(java.lang.String schemaName)
|
private static void |
createXplainTable(LanguageConnectionContext lcc,
java.lang.String schemaName,
XPLAINTableDescriptor t)
|
private static java.sql.Connection |
getDefaultConn()
Get the default or nested connection corresponding to the URL jdbc:default:connection. |
private static java.sql.DatabaseMetaData |
getDMD()
Get the DatabaseMetaData for the current connection for use in mapping the jcc SYSIBM.* calls to the Derby DatabaseMetaData methods |
private static java.lang.String |
getOption(java.lang.String pattern,
java.lang.String options)
Helper for SQLForeignKeys and SQLTables |
private static boolean |
hasSchema(java.sql.Connection conn,
java.lang.String schemaName)
|
private static boolean |
hasTable(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String tableName)
|
static void |
INSTALL_JAR(java.lang.String url,
java.lang.String jar,
int deploy)
Install a jar file in the database. |
private static boolean |
isForODBC(java.lang.String options)
Helper for ODBC metadata calls. |
static double |
LOG10(double value)
Base 10 log function. |
static void |
METADATA(java.sql.ResultSet[] rs)
|
static double |
PI()
Method to return the constant PI. |
static double |
RAND(int seed)
Pseudo-random number function. |
static void |
REMOVE_JAR(java.lang.String jar,
int undeploy)
Remove a jar file from the database. |
private static void |
removeFromAccessList(java.lang.String listProperty,
java.lang.String userName)
Utility method for SYSCS_SET_USER_ACCESS removes a user from one of the access lists, driven by the property name. |
static void |
REPLACE_JAR(java.lang.String url,
java.lang.String jar)
Replace a jar file in the database. |
static int |
SIGN(double value)
Method to return the sign of the given value. |
static double |
SINH(double value)
Hyperbolic Sine function. |
static void |
SQLCAMESSAGE(int sqlcode,
short errmcLen,
java.lang.String sqlerrmc,
java.lang.String sqlerrp,
int errd0,
int errd1,
int errd2,
int errd3,
int errd4,
int errd5,
java.lang.String warn,
java.lang.String sqlState,
java.lang.String file,
java.lang.String localeStr,
java.lang.String[] msg,
int[] rc)
Method used by Derby Network Server to get localized message (original call from jcc. |
static void |
SQLCOLPRIVILEGES(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLColPrivileges to EmbedDatabaseMetaData.getColumnPrivileges |
static void |
SQLCOLUMNS(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLColumns to EmbedDatabaseMetaData.getColumns |
static void |
SQLFOREIGNKEYS(java.lang.String pkCatalogName,
java.lang.String pkSchemaName,
java.lang.String pkTableName,
java.lang.String fkCatalogName,
java.lang.String fkSchemaName,
java.lang.String fkTableName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLForeignKeys to EmbedDatabaseMetaData.getImportedKeys, getExportedKeys, and getCrossReference |
static void |
SQLFUNCTIONPARAMS(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String funcName,
java.lang.String paramName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLFunctionParameters to EmbedDatabaseMetaData.getFunctionColumns() |
static void |
SQLFUNCTIONS(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String funcName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLFunctions to EmbedDatabaseMetaData.getFunctions |
static void |
SQLGETTYPEINFO(short dataType,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLGetTypeInfo to EmbedDatabaseMetaData.getTypeInfo |
static void |
SQLPRIMARYKEYS(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLPrimaryKeys to EmbedDatabaseMetaData.getPrimaryKeys |
static void |
SQLPROCEDURECOLS(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String procName,
java.lang.String paramName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLProcedureCols to EmbedDatabaseMetaData.getProcedureColumns |
static void |
SQLPROCEDURES(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String procName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLProcedures to EmbedDatabaseMetaData.getProcedures |
static void |
SQLSPECIALCOLUMNS(short colType,
java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
short scope,
short nullable,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLSpecialColumns to EmbedDatabaseMetaData.getBestRowIdentifier and getVersionColumns |
static void |
SQLSTATISTICS(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
short unique,
short approximate,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLStatistics to EmbedDatabaseMetaData.getIndexInfo |
static void |
SQLTABLEPRIVILEGES(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLTablePrivileges to EmbedDatabaseMetaData.getTablePrivileges |
static void |
SQLTABLES(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String tableType,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLTables to EmbedDatabaseMetaData.getSchemas, getCatalogs, getTableTypes and getTables, and return the result of the DatabaseMetaData calls. |
static void |
SQLUDTS(java.lang.String catalogName,
java.lang.String schemaPattern,
java.lang.String typeNamePattern,
java.lang.String udtTypes,
java.lang.String options,
java.sql.ResultSet[] rs)
Map SQLUDTS to EmbedDatabaseMetaData.getUDTs |
static void |
SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE_NOWAIT(java.lang.String backupDir,
short deleteOnlineArchivedLogFiles)
Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup. |
static void |
SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(java.lang.String backupDir,
short deleteOnlineArchivedLogFiles)
Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version of the backup. |
static void |
SYSCS_BACKUP_DATABASE_NOWAIT(java.lang.String backupDir)
Backup the database to a backup directory. |
static void |
SYSCS_BACKUP_DATABASE(java.lang.String backupDir)
Backup the database to a backup directory. |
static void |
SYSCS_BULK_INSERT(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String vtiName,
java.lang.String vtiArg)
Perform bulk insert using the specificed vti . |
static int |
SYSCS_CHECK_TABLE(java.lang.String schema,
java.lang.String tablename)
|
static void |
SYSCS_CHECKPOINT_DATABASE()
|
static void |
SYSCS_COMPRESS_TABLE(java.lang.String schema,
java.lang.String tablename,
short sequential)
Compress the table. |
static void |
SYSCS_DISABLE_LOG_ARCHIVE_MODE(short deleteOnlineArchivedLogFiles)
Disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery. |
static void |
SYSCS_EMPTY_STATEMENT_CACHE()
Empty as much of the cache as possible. |
static void |
SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE(java.lang.String selectStatement,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
java.lang.String lobsFileName)
Export data from a select statement to given file. |
static void |
SYSCS_EXPORT_QUERY(java.lang.String selectStatement,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset)
Export data from a select statement to given file. |
static void |
SYSCS_EXPORT_TABLE_LOBS_TO_EXTFILE(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
java.lang.String lobsFileName)
Export data from a table to given files. |
static void |
SYSCS_EXPORT_TABLE(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset)
Export data from a table to given file. |
static void |
SYSCS_FREEZE_DATABASE()
Freeze the database. |
static java.lang.String |
SYSCS_GET_DATABASE_PROPERTY(java.lang.String key)
Get the value of a property of the database in current connection. |
static java.lang.String |
SYSCS_GET_RUNTIMESTATISTICS()
|
static java.lang.String |
SYSCS_GET_USER_ACCESS(java.lang.String userName)
Get the connection level authorization for a specific user - SYSCS_UTIL.SYSCS_GET_USER_ACCESS. |
static int |
SYSCS_GET_XPLAIN_MODE()
This procedure returns the current status of the xplain mode. |
static java.lang.String |
SYSCS_GET_XPLAIN_SCHEMA()
This procedure returns the current set XPLAIN_SCHEMA |
static void |
SYSCS_IMPORT_DATA_LOBS_FROM_EXTFILE(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String insertColumnList,
java.lang.String columnIndexes,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace)
Import data from a given file into the specified table columns from the specified columns in the file. |
static void |
SYSCS_IMPORT_DATA(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String insertColumnList,
java.lang.String columnIndexes,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace)
Import data from a given file into the specified table columns from the specified columns in the file. |
static void |
SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace)
Import data from a given file to a table. |
static void |
SYSCS_IMPORT_TABLE(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String fileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace)
Import data from a given file to a table. |
static void |
SYSCS_INPLACE_COMPRESS_TABLE(java.lang.String schema,
java.lang.String tablename,
short purgeRows,
short defragmentRows,
short truncateEnd)
Implementation of SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(). |
static void |
SYSCS_RELOAD_SECURITY_POLICY()
Reload the policy file. |
static void |
SYSCS_SET_DATABASE_PROPERTY(java.lang.String key,
java.lang.String value)
Set/delete the value of a property of the database in current connection. |
static void |
SYSCS_SET_RUNTIMESTATISTICS(short enable)
|
static void |
SYSCS_SET_STATISTICS_TIMING(short enable)
|
static void |
SYSCS_SET_USER_ACCESS(java.lang.String userName,
java.lang.String connectionPermission)
Set the connection level authorization for a specific user - SYSCS_UTIL.SYSCS_SET_USER_ACCESS. |
static void |
SYSCS_SET_XPLAIN_MODE(int mode)
this procedure switches between the different xplain modes |
static void |
SYSCS_SET_XPLAIN_SCHEMA(java.lang.String schemaName)
This procedure sets the current xplain schema. |
static void |
SYSCS_UNFREEZE_DATABASE()
Unfreeze the database. |
static void |
SYSCS_UPDATE_STATISTICS(java.lang.String schemaname,
java.lang.String tablename,
java.lang.String indexname)
Update the statistics for 1)all the indexes or 2)a specific index on a table. |
static double |
TANH(double value)
Hyperbolic Tangent function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int SQL_BEST_ROWID
private static final int SQL_ROWVER
private static final java.lang.String DRIVER_TYPE_OPTION
private static final java.lang.String ODBC_DRIVER_OPTION
public static final java.lang.String SQLERRMC_MESSAGE_DELIMITER
SQLERRMC_MESSAGE_DELIMITER
When message argument tokes are sent,
this value separates the tokens for mulitiple error messages
private static final double LOG10
Constructor Detail |
---|
public SystemProcedures()
Method Detail |
---|
public static void SQLCAMESSAGE(int sqlcode, short errmcLen, java.lang.String sqlerrmc, java.lang.String sqlerrp, int errd0, int errd1, int errd2, int errd3, int errd4, int errd5, java.lang.String warn, java.lang.String sqlState, java.lang.String file, java.lang.String localeStr, java.lang.String[] msg, int[] rc)
sqlcode
- sqlcode, not used.errmcLen
- sqlerrmc lengthsqlerrmc
- sql error message tokens, variable part of error message (ie.,
arguments) plus messageId, separated by separator.sqlerrp
- not usederrd0
- not usederrd1
- not usederrd2
- not usederrd3
- not usederrd4
- not usederrd5
- not usedwarn
- not usedsqlState
- 5-char sql statefile
- not usedlocaleStr
- client locale in stringmsg
- OUTPUT parameter, localized error messagerc
- OUTPUT parameter, return code -- 0 for successprivate static java.sql.Connection getDefaultConn() throws java.sql.SQLException
java.sql.SQLException
- Not running in a SQL statementprivate static java.sql.DatabaseMetaData getDMD() throws java.sql.SQLException
java.sql.SQLException
public static void SQLPROCEDURES(java.lang.String catalogName, java.lang.String schemaName, java.lang.String procName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLProcedures CatalogName varchar(128),schemaName
- SYSIBM.SQLProcedures SchemaName varchar(128),procName
- SYSIBM.SQLProcedures ProcName varchar(128),options
- SYSIBM.SQLProcedures Options varchar(4000))rs
- output parameter, the resultset object containing
the result of getProcedures
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.
java.sql.SQLException
public static void SQLFUNCTIONS(java.lang.String catalogName, java.lang.String schemaName, java.lang.String funcName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLFunctions CatalogName varchar(128),schemaName
- SYSIBM.SQLFunctions SchemaName varchar(128),funcName
- SYSIBM.SQLFunctions ProcName varchar(128),options
- SYSIBM.SQLFunctions Options varchar(4000))
(not used)rs
- output parameter, the resultset object containing
the result of getFunctions
java.sql.SQLException
public static void SQLTABLES(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String tableType, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
JCC and DNC overload this method:
catalogName
- SYSIBM.SQLTables CatalogName varchar(128),schemaName
- SYSIBM.SQLTables SchemaName varchar(128),tableName
- SYSIBM.SQLTables TableName varchar(128),tableType
- SYSIBM.SQLTables TableType varchar(4000))options
- SYSIBM.SQLTables Options varchar(4000))rs
- output parameter, the resultset object
java.sql.SQLException
public static void SQLFOREIGNKEYS(java.lang.String pkCatalogName, java.lang.String pkSchemaName, java.lang.String pkTableName, java.lang.String fkCatalogName, java.lang.String fkSchemaName, java.lang.String fkTableName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
pkCatalogName
- SYSIBM.SQLForeignKeys PKCatalogName varchar(128),pkSchemaName
- SYSIBM.SQLForeignKeys PKSchemaName varchar(128),pkTableName
- SYSIBM.SQLForeignKeys PKTableName varchar(128),fkCatalogName
- SYSIBM.SQLForeignKeys FKCatalogName varchar(128),fkSchemaName
- SYSIBM.SQLForeignKeys FKSchemaName varchar(128),fkTableName
- SYSIBM.SQLForeignKeys FKTableName varchar(128),options
- SYSIBM.SQLForeignKeys Options varchar(4000))rs
- output parameter, the resultset object
containing the result of the DatabaseMetaData calls
JCC overloads this method:
If options contains the string 'EXPORTEDKEY=1', call getImportedKeys
If options contains the string 'IMPORTEDKEY=1', call getExportedKeys
otherwise, call getCrossReference
java.sql.SQLException
private static java.lang.String getOption(java.lang.String pattern, java.lang.String options)
pattern
- String containing the option to search foroptions
- String containing the options to search through
public static void SQLPROCEDURECOLS(java.lang.String catalogName, java.lang.String schemaName, java.lang.String procName, java.lang.String paramName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLProcedureCols CatalogName varchar(128),schemaName
- SYSIBM.SQLProcedureCols SchemaName varchar(128),procName
- SYSIBM.SQLProcedureCols ProcName varchar(128),paramName
- SYSIBM.SQLProcedureCols ParamName varchar(128),options
- SYSIBM.SQLProcedureCols Options varchar(4000))rs
- output parameter, the resultset object containing
the result of getProcedureColumns
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.
java.sql.SQLException
public static void SQLFUNCTIONPARAMS(java.lang.String catalogName, java.lang.String schemaName, java.lang.String funcName, java.lang.String paramName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLFunctionParameters CatalogName
varchar(128),schemaName
- SYSIBM.SQLFunctionParameters SchemaName
varchar(128),funcName
- SYSIBM.SQLFunctionParameters FuncName
varchar(128),paramName
- SYSIBM.SQLFunctionParameters ParamName
varchar(128),options
- SYSIBM.SQLFunctionParameters Options
varchar(4000))rs
- output parameter, the resultset object containing the
result of getFunctionColumns().
java.sql.SQLException
public static void SQLCOLUMNS(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLColumns CatalogName varchar(128),schemaName
- SYSIBM.SQLColumns SchemaName varchar(128),tableName
- SYSIBM.SQLColumns TableName varchar(128),columnName
- SYSIBM.SQLColumns ColumnName varchar(128),options
- SYSIBM.SQLColumns Options varchar(4000))
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.rs
- output parameter, the resultset object containing
the result of getProcedures
java.sql.SQLException
public static void SQLCOLPRIVILEGES(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLColPrivileges CatalogName varchar(128),schemaName
- SYSIBM.SQLColPrivileges SchemaName varchar(128),tableName
- SYSIBM.SQLColPrivileges ProcName varchar(128),columnName
- SYSIBM.SQLColPrivileges ColumnName varchar(128),options
- SYSIBM.SQLColPrivileges Options varchar(4000))rs
- output parameter, the resultset object containing
the result of getColumnPrivileges
java.sql.SQLException
public static void SQLTABLEPRIVILEGES(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLTablePrivileges CatalogName varchar(128),schemaName
- SYSIBM.SQLTablePrivileges SchemaName varchar(128),tableName
- SYSIBM.SQLTablePrivileges ProcName varchar(128),options
- SYSIBM.SQLTablePrivileges Options varchar(4000))rs
- output parameter, the resultset object containing
the result of getTablePrivileges
java.sql.SQLException
public static void SQLPRIMARYKEYS(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLPrimaryKeys CatalogName varchar(128),schemaName
- SYSIBM.SQLPrimaryKeys SchemaName varchar(128),tableName
- SYSIBM.SQLPrimaryKeys TableName varchar(128),options
- SYSIBM.SQLPrimaryKeys Options varchar(4000))
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.rs
- output parameter, the resultset object containing
the result of getPrimaryKeys
java.sql.SQLException
public static void SQLGETTYPEINFO(short dataType, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
dataType
- SYSIBM.SQLGetTypeInfo DataType smallint,options
- SYSIBM.SQLGetTypeInfo Options varchar(4000))
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.rs
- output parameter, the resultset object containing the
result of getTypeInfo
java.sql.SQLException
public static void SQLSTATISTICS(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, short unique, short approximate, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLStatistics CatalogName varchar(128),schemaName
- SYSIBM.SQLStatistics SchemaName varchar(128),tableName
- SYSIBM.SQLStatistics TableName varchar(128),unique
- SYSIBM.SQLStatistics Unique smallint; 0=SQL_INDEX_UNIQUE(0); 1=SQL_INDEX_ALL(1),approximate
- SYSIBM.SQLStatistics Approximate smallint; 1=true; 0=false,options
- SYSIBM.SQLStatistics Options varchar(4000))
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.rs
- output parameter, the resultset object containing
the result of getIndexInfo
java.sql.SQLException
public static void SQLSPECIALCOLUMNS(short colType, java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, short scope, short nullable, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
colType
- SYSIBM.SQLSpecialColumns ColType smallint,
where 1 means getBestRowIdentifier and 2 getVersionColumns was called.catalogName
- SYSIBM.SQLSpecialColumns CatalogName varchar(128),schemaName
- SYSIBM.SQLSpecialColumns SchemaName varchar(128),tableName
- SYSIBM.SQLSpecialColumns TableName varchar(128),scope
- SYSIBM.SQLSpecialColumns Scope smallint,nullable
- SYSIBM.SQLSpecialColumns Nullable smallint; 0=false, 1=true,options
- SYSIBM.SQLSpecialColumns Options varchar(4000))
If options contains the string 'DATATYPE='ODBC'', call the ODBC
version of this procedure.rs
- output parameter, the resultset object containing
the result of the DatabaseMetaData call
java.sql.SQLException
public static void SQLUDTS(java.lang.String catalogName, java.lang.String schemaPattern, java.lang.String typeNamePattern, java.lang.String udtTypes, java.lang.String options, java.sql.ResultSet[] rs) throws java.sql.SQLException
catalogName
- SYSIBM.SQLUDTS CatalogName varchar(128),schemaPattern
- SYSIBM.SQLUDTS Schema_Name_Pattern varchar(128),typeNamePattern
- SYSIBM.SQLUDTS Type_Name_Pattern varchar(128),udtTypes
- SYSIBM.SQLUDTS UDTTypes varchar(128),options
- SYSIBM.SQLUDTS Options varchar(4000))rs
- output parameter, the resultset object containing
the result of getUDTs, which will be empty
java.sql.SQLException
public static void METADATA(java.sql.ResultSet[] rs) throws java.sql.SQLException
java.sql.SQLException
private static boolean isForODBC(java.lang.String options)
options
- String containig the options to search through.
public static void SYSCS_SET_DATABASE_PROPERTY(java.lang.String key, java.lang.String value) throws java.sql.SQLException
Will be called as SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY.
key
- The property key.value
- The new value, if null the property is deleted.
StandardException
- Standard exception policy.
java.sql.SQLException
public static java.lang.String SYSCS_GET_DATABASE_PROPERTY(java.lang.String key) throws java.sql.SQLException
Will be called as SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY.
key
- The property key.
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_UPDATE_STATISTICS(java.lang.String schemaname, java.lang.String tablename, java.lang.String indexname) throws java.sql.SQLException
Calls either "alter table tablename all update statistics " sql or "alter table tablename update statistics indexname" sql This routine will be called when an application calls: SYSCS_UTIL.SYSCS_UPDATE_STATISTICS
schemaname
- schema name of the index(es) whose statistics will
be updated. Must be non-null, no default is used.tablename
- table name of the index(es) whose statistics will
be updated. Must be non-null.indexname
- Can be null. If not null or emptry string then the
user wants to update the statistics for only this
index. If null, then update the statistics for all
the indexes for the given table name.
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_COMPRESS_TABLE(java.lang.String schema, java.lang.String tablename, short sequential) throws java.sql.SQLException
Calls the "alter table compress {sequential}" sql. This syntax is not db2 compatible so it mapped by a system routine. This routine will be called when an application calls: SYSCS_UTIL.SYSCS_COMPRESS_TABLE
schema
- schema name of the table to compress. Must be
non-null, no default is used.tablename
- table name of the table to compress. Must be
non-null.sequential
- if non-zero then rebuild indexes sequentially,
if 0 then rebuild all indexes in parallel.
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_FREEZE_DATABASE() throws java.sql.SQLException
Call internal routine to freeze the database so that a backup can be made.
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_UNFREEZE_DATABASE() throws java.sql.SQLException
Call internal routine to unfreeze the database, which was "freezed" by calling SYSCS_FREEZE_DATABASE(). can be made.
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_CHECKPOINT_DATABASE() throws java.sql.SQLException
java.sql.SQLException
public static void SYSCS_BACKUP_DATABASE(java.lang.String backupDir) throws java.sql.SQLException
backupDir
- the name of the directory where the backup should be
stored. This directory will be created if it
does not exist.
StandardException
- thrown on error
java.sql.SQLException
public static void SYSCS_BACKUP_DATABASE_NOWAIT(java.lang.String backupDir) throws java.sql.SQLException
backupDir
- the name of the directory where the backup should be
stored. This directory will be created if it
does not exist.
StandardException
- thrown on error
java.sql.SQLException
public static void SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(java.lang.String backupDir, short deleteOnlineArchivedLogFiles) throws java.sql.SQLException
backupDir
- the name of the directory where the backup should be
stored. This directory will be created if not it
does not exist.deleteOnlineArchivedLogFiles
- If non-zero deletes online
archived log files that exist before this backup, delete
will occur only after the backup is complete.
StandardException
- thrown on error.
java.sql.SQLException
public static void SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE_NOWAIT(java.lang.String backupDir, short deleteOnlineArchivedLogFiles) throws java.sql.SQLException
backupDir
- the name of the directory where the backup should be
stored. This directory will be created if not it
does not exist.deleteOnlineArchivedLogFiles
- If non-zero deletes online
archived log files that exist before this backup, delete
will occur only after the backup is complete.
StandardException
- thrown on error.
java.sql.SQLException
public static void SYSCS_DISABLE_LOG_ARCHIVE_MODE(short deleteOnlineArchivedLogFiles) throws java.sql.SQLException
deleteOnlineArchivedLogFiles
- If non-zero deletes all the
online archived log files that exist before this call immediately.
StandardException
- Thrown on error
java.sql.SQLException
public static void SYSCS_SET_RUNTIMESTATISTICS(short enable) throws java.sql.SQLException
java.sql.SQLException
public static void SYSCS_SET_STATISTICS_TIMING(short enable) throws java.sql.SQLException
java.sql.SQLException
public static int SYSCS_CHECK_TABLE(java.lang.String schema, java.lang.String tablename) throws java.sql.SQLException
java.sql.SQLException
public static void SYSCS_INPLACE_COMPRESS_TABLE(java.lang.String schema, java.lang.String tablename, short purgeRows, short defragmentRows, short truncateEnd) throws java.sql.SQLException
Code which implements the following system procedure: void SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE( IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN PURGE_ROWS SMALLINT, IN DEFRAGMENT_ROWS SMALLINT, IN TRUNCATE_END SMALLINT)
Use the SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE system procedure to reclaim unused, allocated space in a table and its indexes. Typically, unused allocated space exists when a large amount of data is deleted from a table, and there have not been subsequent inserts to use the space freed by the deletes. By default, Derby does not return unused space to the operating system. For example, once a page has been allocated to a table or index, it is not automatically returned to the operating system until the table or index is destroyed. SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE allows you to return unused space to the operating system.
This system procedure can be used to force 3 levels of in place compression of a SQL table: PURGE_ROWS, DEFRAGMENT_ROWS, TRUNCATE_END. Unlike SYSCS_UTIL.SYSCS_COMPRESS_TABLE() all work is done in place in the existing table/index.
Syntax: SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE( IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN PURGE_ROWS SMALLINT, IN DEFRAGMENT_ROWS SMALLINT, IN TRUNCATE_END SMALLINT)
SCHEMANAME: An input argument of type VARCHAR(128) that specifies the schema of the table. Passing a null will result in an error.
TABLENAME: An input argument of type VARCHAR(128) that specifies the table name of the table. The string must exactly match the case of the table name, and the argument of "Fred" will be passed to SQL as the delimited identifier 'Fred'. Passing a null will result in an error.
PURGE_ROWS: If PURGE_ROWS is set to non-zero then a single pass is made through the table which will purge committed deleted rows from the table. This space is then available for future inserted rows, but remains allocated to the table. As this option scans every page of the table, it's performance is linearly related to the size of the table.
DEFRAGMENT_ROWS: If DEFRAGMENT_ROWS is set to non-zero then a single defragment pass is made which will move existing rows from the end of the table towards the front of the table. The goal of the defragment run is to empty a set of pages at the end of the table which can then be returned to the OS by the TRUNCATE_END option. It is recommended to only run DEFRAGMENT_ROWS, if also specifying the TRUNCATE_END option. This option scans the whole table and needs to update index entries for every base table row move, and thus execution time is linearly related to the size of the table.
TRUNCATE_END: If TRUNCATE_END is set to non-zero then all contiguous pages at the end of the table will be returned to the OS. Running the PURGE_ROWS and/or DEFRAGMENT_ROWS passes options may increase the number of pages affected. This option itself does no scans of the table, so performs on the order of a few system calls.
SQL example: To compress a table called CUSTOMER in a schema called US, using all available compress options: call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('US', 'CUSTOMER', 1, 1, 1); To quickly just return the empty free space at the end of the same table, this option will run much quicker than running all phases but will likely return much less space: call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('US', 'CUSTOMER', 0, 0, 1); Java example: To compress a table called CUSTOMER in a schema called US, using all available compress options: CallableStatement cs = conn.prepareCall ("CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?, ?, ?)"); cs.setString(1, "US"); cs.setString(2, "CUSTOMER"); cs.setShort(3, (short) 1); cs.setShort(4, (short) 1); cs.setShort(5, (short) 1); cs.execute(); To quickly just return the empty free space at the end of the same table, this option will run much quicker than running all phases but will likely return much less space: CallableStatement cs = conn.prepareCall ("CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?, ?, ?)"); cs.setString(1, "US"); cs.setString(2, "CUSTOMER"); cs.setShort(3, (short) 0); cs.setShort(4, (short) 0); cs.setShort(5, (short) 1); cs.execute();
It is recommended that the SYSCS_UTIL.SYSCS_COMPRESS_TABLE procedure is issued in auto-commit mode. Note: This procedure acquires an exclusive table lock on the table being compressed. All statement plans dependent on the table or its indexes are invalidated. For information on identifying unused space, see the Derby Server and Administration Guide. TODO LIST: o defragment requires table level lock in nested user transaction, which will conflict with user lock on same table in user transaction.
java.sql.SQLException
public static java.lang.String SYSCS_GET_RUNTIMESTATISTICS() throws java.sql.SQLException
java.sql.SQLException
public static void INSTALL_JAR(java.lang.String url, java.lang.String jar, int deploy) throws java.sql.SQLException
url
- URL of the jar file to be installed in the database.jar
- SQL name jar will be installed as.deploy
- Ignored.
java.sql.SQLException
- Error installing jar file.public static void REPLACE_JAR(java.lang.String url, java.lang.String jar) throws java.sql.SQLException
url
- URL of the jar file to be installed in the database.jar
- SQL name of jar to be replaced.
java.sql.SQLException
- Error replacing jar file.public static void REMOVE_JAR(java.lang.String jar, int undeploy) throws java.sql.SQLException
jar
- SQL name of jar to be replaced.undeploy
- Ignored.
java.sql.SQLException
- Error removing jar file.private static void checkJarSQLName(java.lang.String sqlName) throws StandardException
StandardException
public static void SYSCS_EXPORT_TABLE(java.lang.String schemaName, java.lang.String tableName, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset) throws java.sql.SQLException
Will be called by system procedure: SYSCS_EXPORT_TABLE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128))
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_EXPORT_TABLE_LOBS_TO_EXTFILE(java.lang.String schemaName, java.lang.String tableName, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, java.lang.String lobsFileName) throws java.sql.SQLException
Will be called by system procedure: SYSCS_EXPORT_TABLE_LOBS_TO_EXTFILE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128), IN LOBSFILENAME VARCHAR(32672))
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_EXPORT_QUERY(java.lang.String selectStatement, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset) throws java.sql.SQLException
Will be called as SYSCS_EXPORT_QUERY(IN SELECTSTATEMENT VARCHAR(32672), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128))
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE(java.lang.String selectStatement, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, java.lang.String lobsFileName) throws java.sql.SQLException
Will be called as SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE(IN SELECTSTATEMENT VARCHAR(32672), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128), IN LOBSFILENAME VARCHAR(32672))
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_IMPORT_TABLE(java.lang.String schemaName, java.lang.String tableName, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace) throws java.sql.SQLException
Will be called by system procedure as SYSCS_IMPORT_TABLE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128), IN REPLACE SMALLINT)
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE(java.lang.String schemaName, java.lang.String tableName, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace) throws java.sql.SQLException
Will be called by system procedure as SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN FILENAME VARCHAR(32672) , IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1) , IN CODESET VARCHAR(128), IN REPLACE SMALLINT)
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_IMPORT_DATA(java.lang.String schemaName, java.lang.String tableName, java.lang.String insertColumnList, java.lang.String columnIndexes, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace) throws java.sql.SQLException
Will be called as SYSCS_IMPORT_DATA (IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN INSERTCOLUMNLIST VARCHAR(32762), IN COLUMNINDEXES VARCHAR(32762), IN FILENAME VARCHAR(32762), IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1), IN CODESET VARCHAR(128), IN REPLACE SMALLINT)
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_IMPORT_DATA_LOBS_FROM_EXTFILE(java.lang.String schemaName, java.lang.String tableName, java.lang.String insertColumnList, java.lang.String columnIndexes, java.lang.String fileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace) throws java.sql.SQLException
Will be called as SYSCS_IMPORT_DATA_LOBS_FROM_EXTFILE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN INSERTCOLUMNLIST VARCHAR(32762), IN COLUMNINDEXES VARCHAR(32762), IN FILENAME VARCHAR(32762), IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1), IN CODESET VARCHAR(128), IN REPLACE SMALLINT)
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_BULK_INSERT(java.lang.String schemaName, java.lang.String tableName, java.lang.String vtiName, java.lang.String vtiArg) throws java.sql.SQLException
Will be called as SYSCS_BULK_INSERT (IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN VTINAME VARCHAR(32762), IN VTIARG VARCHAR(32762))
StandardException
- Standard exception policy.
java.sql.SQLException
public static void SYSCS_RELOAD_SECURITY_POLICY() throws java.sql.SQLException
System procedure called thusly: SYSCS_UTIL.SYSCS_RELOAD_SECURITY_POLICY()
java.sql.SQLException
public static double PI()
public static double LOG10(double value)
log(value) / log(10)
where log is the natural log.
public static double COT(double value)
public static double COSH(double value)
public static double SINH(double value)
public static double TANH(double value)
public static int SIGN(double value)
public static double RAND(int seed)
public static void SYSCS_SET_USER_ACCESS(java.lang.String userName, java.lang.String connectionPermission) throws java.sql.SQLException
userName
- name of the user in its normal form (not a SQL identifier).connectionPermission
-
java.sql.SQLException
- Error setting the permissionprivate static void removeFromAccessList(java.lang.String listProperty, java.lang.String userName) throws java.sql.SQLException, StandardException
java.sql.SQLException
StandardException
public static java.lang.String SYSCS_GET_USER_ACCESS(java.lang.String userName) throws java.sql.SQLException
userName
- name of the user in its normal form (not a SQL identifier).
java.sql.SQLException
public static void SYSCS_EMPTY_STATEMENT_CACHE() throws java.sql.SQLException
java.sql.SQLException
public static void SYSCS_SET_XPLAIN_MODE(int mode) throws java.sql.SQLException, StandardException
mode
- either 0 for explain only, or 1 for explain & execute (default)
java.sql.SQLException
StandardException
public static int SYSCS_GET_XPLAIN_MODE() throws java.sql.SQLException, StandardException
java.sql.SQLException
StandardException
public static void SYSCS_SET_XPLAIN_SCHEMA(java.lang.String schemaName) throws java.sql.SQLException, StandardException
schemaName
- May be an empty string.
java.sql.SQLException
StandardException
private static boolean hasSchema(java.sql.Connection conn, java.lang.String schemaName) throws java.sql.SQLException
java.sql.SQLException
private static boolean hasTable(java.sql.Connection conn, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException
java.sql.SQLException
private static void createXplainSchema(java.lang.String schemaName) throws java.sql.SQLException
java.sql.SQLException
private static void createXplainTable(LanguageConnectionContext lcc, java.lang.String schemaName, XPLAINTableDescriptor t) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String SYSCS_GET_XPLAIN_SCHEMA() throws java.sql.SQLException, StandardException
java.sql.SQLException
StandardException
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |