Today in the development of a problem encountered, in this record, the problem is probably the meaning of the type is inconsistent can not be a strong turn
The code is as follows:
ROLF.SETFUNCD (String) rece.get ("FUN_CD");//strong Transfer Rolf.setfunid ((string) rece.get ("fun_id"); Strong Turn rolf.setfunnm (String) rece.get ("fun_nm"); Strong turn
Because my second paragraph of code the field type of the ORC database is number, and the entity type is string
So I was in the execution of the error, Java.math.BigDecimal cannot is cast to java.lang.String
Change the second piece of code to the following format. ToString () error is dismissed because:
ROLF.SETFUNCD (String) rece.get ("FUN_CD");//strong Turn Rolf.setfunid (Rece.get ("fun_id"). toString ()); The explanations are as follows ROLF.SETFUNNM (String) rece.get ("fun_nm"));
ToString is a method of the object class, and all classes inherit from the object class. If you define a class that does not overwrite the ToString method, the object uses the object class ToString method when calling the ToString method
This article is from the "Yipaixiaoyayin" blog, make sure to keep this source http://yipaixiaoyayin.blog.51cto.com/8812323/1910085
Java.math.BigDecimal cannot is cast to java.lang.String----solution