Spring 读取配置文件并调用 bean package cn.com.test.receive; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class
int intA = 0;1.intA =int.Parse(str);2.int.TryParse(str, out intA);3.intA = Convert.ToInt32(str);以上都可以,其中 1和3 需要try{}异常,2不需要. //TryParse() Usage1: int number; bool result = Int32.TryParse(value, out number); // return bool value hint y/n if (result) {
--使用CAST将varchar转换成int类型排序 select distinct(zone_id) from guild_rank_info order by CAST(zone_id as SIGNED); --使用CONVERT将varchar转换成int类型排序 select distinct(zone_id) from guild_rank_info order by convert(zone_id , SIGNED); null
spring读取dubbo xml文件,在本项目内可以调用正常,一旦把改项目打成jar包,供其他项目调用,就会提示找不到配置文件 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:app-dubbo-client-context.xml"); 有找到 app-dubbo-client-context.xml , cannot be opened because