@Configuration//设置本类为配置类
@ComponentScan("com.xlu")//设置扫描的包
@PropertySource("classpath:jdbc.properties")//读取配置文件
@Import(ConfigJdbc.class)//引用另一个配置文件
@Value("${jdbc.driver}")//引用配置文件中的键值对
@Bean("runner")//配置为java类
@Scope("prototype")//多例
ApplicationContext ac=new AnnotationConfigApplicationContext(ConfigSpring.class);