jdbcdaosupportmain.java

来自「是关于struts+hibernate+spring开发宝典的源代码,希望对大家」· Java 代码 · 共 23 行

JAVA
23
字号
package cn.hxex.springcore.jdbc;

import java.util.List;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class JdbcDaoSupportMain {

	public static void main(String[] args) {
		
		ClassPathResource resource = new ClassPathResource("cn/hxex/springcore/jdbc/JdbcDaoSupportBeans.xml");
		BeanFactory factory = new XmlBeanFactory(resource);

		IDeptDao dao = (IDeptDao)factory.getBean( "deptDao" );
		List depts = dao.getDepts();
		for( int i=0; i<depts.size(); i++ ) {
			System.out.println( depts.get( i ) );
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?