Small problems encountered in the program

1. The character string is divided by "." period, use the following operations

String[] segmentsattr = segments.split(" \\. "); //Split by "."

2. The database type is number type. When Java obtains data and converts it to Int type:

   List list = query.list();

   int  count = list.get(0);

Reported an error: java.math.BigDecimal cannot be cast to java.lang.Integer

solution:

Listlist = query.list();

int count = 0;

if(null != list && list.size() > 0){

count = Integer.parseInt(list.get(0).toString());

}

return count;

 

}

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326272701&siteId=291194637