package mypack;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;public class Test { public static void main(String[] args) { try {
SessionFactory sf =
new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
Transaction tx = session.beginTransaction(); for (int i = 0; i < 200; i++) {
Customer customer = new Customer();
customer.setUsername("customer" + i);
customer.setPassword("customer");
session.save(customer);
} tx.commit();
session.close(); } catch (HibernateException e) {
e.printStackTrace();
}
}
}
编译时报错,内容是找不到net.sf.hibernate.*;和net.sf.hibernate.cfg.*;这2个文件
我已经把HIBERNATE目录下的hibernate.jar以及LIB里的所有jar文件复制到项目的LIB目录下了,而且用classpath配置了hibernate.jar路径。但还是找不到以上2个包
求帮忙
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;public class Test { public static void main(String[] args) { try {
SessionFactory sf =
new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
Transaction tx = session.beginTransaction(); for (int i = 0; i < 200; i++) {
Customer customer = new Customer();
customer.setUsername("customer" + i);
customer.setPassword("customer");
session.save(customer);
} tx.commit();
session.close(); } catch (HibernateException e) {
e.printStackTrace();
}
}
}
编译时报错,内容是找不到net.sf.hibernate.*;和net.sf.hibernate.cfg.*;这2个文件
我已经把HIBERNATE目录下的hibernate.jar以及LIB里的所有jar文件复制到项目的LIB目录下了,而且用classpath配置了hibernate.jar路径。但还是找不到以上2个包
求帮忙
解决方案 »
- freemarker问题?如何直接调用java类的某个方法?
- JSP不能上传文件的问题
- session 问题
- 怎么样写一个带session的登陆界面!(菜鸟问题)
- JSP调用SQL SERVER存储过程出的问题 请教
- 关于邮件发送正文带图片问题
- 怎么基于JAVA平台实现远程视频监控,求指导
- 不急不问:用JSP访问数据库,如何让取回的大段文本显示时自动换行?
- 我是新手,高手,高手,快来救我
- tomcat 启动时候报错,Error creating bean with name 'areaxxxImpl': Injection of resource
- byte类型转成doc文件保存
- 请问这个异常如何解决?
是hibernate的把包名