Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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(Address.java:3433)
at training_sh.address_0_1.Address.tOracleConnection_2Process(Address.java:343)
at training_sh.address_0_1.Address.runJobInTOS(Address.java:4409)
at training_sh.address_0_1.Address.main(Address.java:4280)
Anyone got any idea on how I convert a small int (short) to an int such that this error message stops
Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi,
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.
-Carl