KyFrameJAVA 的开发框架工具
KyFrame 是一套JAVA的开发框架工具。
测试代码:
package action;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import dao.User;
import dao.UserDAO;
/**
* @author syb
*
*/
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
//下面两句获取上下文及hibernate的数据模型对象DAO
ApplicationContext ctx = new FileSystemXmlApplicationContext("C:\\Users\\lenovo\\Workspaces\\MyEclipse 8.5\\ssh20140605\\src\\applicationContext.xml");
UserDAO userDAO = (UserDAO) ctx.getBean("UserDAO");
User u=new User();
u.setId(0);
u.setName("111");
u.setCity("w");
u.setCountry("sss");
//u.setCreditLimit(new Integer(10));
userDAO.save(u);
} catch (BeansException e) {
System.out.println(e.getMessage());
}
catch(Exception ee){
System.out.println(ee.getMessage());
}
}
}评论
