Certain methods require values to be specified for input parameters and if so, additional fields are automatically displayed in the Parameters field in the Java Job Properties pane. You must specify values, which can be a primitive type (for example, string or long), or non-primitive type (for example java.sql.Date or any other of your proprietary classes). A Java class constructor can use various parameters to construct a non-primitive type class. These can be either primitive or non-primitive parameters.
EXAMPLE: The following non-primitive input parameter requires three integer (int) parameters:
java.sql.Date
Control-M for Java also supports the NULL type. If the intended value of a parameter is NULL (not a literal NULL), enter \\NULL\\ or \\null\\ (wrapping needs to be in double brackets).
When specifying the parameter type, you must use the “casting like” format, by surrounding the parameter type with parentheses. For example, (int), (long), and (java.lang.String). When the parameter type is specified, the value can either be surrounded by parentheses, displayed in quotes (“), or separated by spaces. However, if the string is complex and contains nested declarations, it is recommended to use parentheses “(x)”.
NOTE: Corresponding parameter values should not include a declaration of the parameter type displayed in the Type field.
EXAMPLE: For the non-primitive input parameter java.sql.Date, when the values shown below are specified, Control-M for CONTROL-M for Java Applications uses the new java.sql.Date(104, 11, 8) constructor to create the date December 8, 2004. Values: (int)104 (int)11 (int)8.
Type: java.sql.Date Value: (int)104 (int)11 (int)8 Name: myDate
NOTE: To use quotation marks inside a string, you can use double quotation marks. For example, instead of - "My name is "John" Smith", you must write - "My name is ""John"" Smith".
Arrays: All items of the array should be written in the same Value field separated by spaces. (Only one-dimensional input parameter arrays are supported.)
EXAMPLE
1. The string 1 2 77 in the value field of the int [] input parameter represents an int array containing the items 1, 2, 77.
2. The value of the java.lang.String [] string array is the following string:
hi my name is "John Doe" with the items (0. hi 1. my 2. name 3. is 4. John Doe).
NOTE: The items are numbered in order to indicate the index number of each item in the string array.
3. The value of the java.sql.Date [] date array input parameter is the following string:
(java.sql.Date)((int)104 (int)11 (int)8) (java.sql.Date)((int)104 (int)11 (int)9) (java.sql.Date)((int)104 (int)11 (int)10). This represents a java.sql.Date array containing the date items December 8, 2004, December 9, 2004, December 10, 2004.
NOTE: CONTROL-M Java Applications supports the invocation of main methods. Use the array syntax in order to define the string array input parameter.
Parent Topic |