One Star

Casting Short to Integer

Passing an element from OracleInput to tmap I get the error;
Exception in component tMap_1
java.lang.ClassCastException: java.lang.Short cannot be cast to java.lang.Integer
at training_sh.address_0_1.Address.tMSSqlInput_1Process(
at training_sh.address_0_1.Address.tOracleConnection_2Process(
at training_sh.address_0_1.Address.runJobInTOS(
at training_sh.address_0_1.Address.main(
Anyone got any idea on how I convert a small int (short) to an int such that this error message stops
One Star

Re: Casting Short to Integer

To reconcile the types, use a "new Integer()" constructor on the Short object. For instance
Short num = new Short((short)1);
Integer num_i = new Integer(num); // in tMap: "new Integer(row1.numericValue)"
Alternatively, you can set all type schemas to use Integer.