
Anonymous
Not applicable
2011-06-23
06:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
252 Views
1 Reply

Anonymous
Not applicable
2011-06-23
07:26 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
252 Views
