hibernate获取SessionFactory失败 咋办?
如题 代码:
package com.test.tree.client;import org.hibernate.cfg.Configuration;import org.hibernate.Session;import org.hibernate.SessionFactory;import com.test.pojo.Book;public class HibernateTest{ public static void main(String[] args) { Configuration cfg = new Configuration().configure(); SessionFactory factory = cfg.buildSessionFactory(); Session session = factory.openSession();; session.beginTransaction(); Book book = new Book(); book.setBook_name("轻量级JavaEE企业应用实战"); book.setBook_editor("李刚"); book.setBook_pub("电子工业出版社"); book.setBook_price((float) 99.00); session.save(book); session.getTransaction().commit(); }}