This directory (/demo/util/methodalias) contains scripts that load useful method aliases into a Cloudscape database. A method alias is a database object that provides an easy way to execute a Java method within an SQL-J statement as if it were a built-in function.
Run these scripts as is, modify them, or use them as an example to load method aliases of your choice into a database.
For more information about method aliases, see the Cloudscape Developer's Guide.
These scripts are ij scripts. ij is a Cloudscape SQL scripting tool. For more information about ij, see the Cloudscape Tools and Utilities Guide. (You can also run these scripts in Cloudview, but instructions are not provided here for doing that.)
Defines method aliases for methods in COM.cloudscape.util.BitUtil. These methods allow you to manipulate bit sets in the database.
Defines method aliases for methods in java.lang.Math. You must modify the script to define method aliases for java.lang.Math.min and java.lang.Math.max.
Defines method aliases for methods in VisualNumerics.math.SFun.
Defines method aliases for methods in COM.cloudscape.Database.PropertyInfo.
These methods make it easy to manage database properties. For more information about database properties, see Tuning Cloudscape.
Defines a a method alias for one of the methods of Cloudscape's ConsistencyChecker utility. (For information on how to use the utility, see Cloudscape Server and Administration Guide.)
Set class path correctly for your environment. ij uses the library tools.jar (%CLOUDSCAPE_INSTALL%/lib/tools.jar). See Getting Started with Cloudscape for information about setting class path.
If you are working in a client/server environment, these directions assume that the server is already running.
java -Dij.protocol = protocolForEnvironment
COM.cloudscape.tools.ij
where protocolForEnvironment is one of the following:
Specifying the correct protocol loads the correct driver when ij starts up.
Specify the full path to the database or a path relative to the current directory.
ij -Dij.protocol=jdbc:cloudscape: ij>Connect 'toursDB';
To run a script, supply it as an argument to the ij command Run. For example:
ij> run 'c:\\cloudscape\\demo\\util\\methodalias\\math.sql';
ij echoes the commands as it executes them.
Alias Name
Java Class Name
Method Name
GETDATABASEPROPERTIES
COM.cloudscape.database.PropertyInfo
getDatabaseProperties
GETDATABASEPROPERTY
COM.cloudscape.database.PropertyInfo
getDatabaseProperty
GETINDEXPROPERTIES
COM.cloudscape.database.PropertyInfo
getIndexProperties
GETTABLEPROPERTIES
COM.cloudscape.database.PropertyInfo
getTableProperties
SETDATABASEPROPERTY
COM.cloudscape.database.PropertyInfo
setDatabaseProperty
BITCLEAR
COM.cloudscape.util.BitUtil
clear
BITGET
COM.cloudscape.util.BitUtil
get
BITSET
COM.cloudscape.util.BitUtil
set
COT
VisualNumerics.math.SFun
cot
LOG10
VisualNumerics.math.SFun
log10
ABS
java.lang.Math
abs
ACOS
java.lang.Math
acos
ASIN
java.lang.Math
asin
ATAN
java.lang.Math
atan
ATAN2
java.lang.Math
atan2
CEIL
java.lang.Math
ceil
COS
java.lang.Math
cos
EXP
java.lang.Math
exp
FLOOR
java.lang.Math
floor
IEEEREMAINDER
java.lang.Math
IEEEremainder
LOG
java.lang.Math
log
POW
java.lang.Math
pow
RANDOM
java.lang.Math
random
RINT
java.lang.Math
rint
ROUND
java.lang.Math
round
SIN
java.lang.Math
sin
SQRT
java.lang.Math
sqrt
TAN
java.lang.Math
tan
CHECKTABLE
COM.cloudscape.database.ConsistencyChecker
checkTable
Cloudscape Version 3.6
For technical support, go to: www.informix.com and click Services.