Hibernate 4 Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

后端 未结 12 1723
青春惊慌失措
青春惊慌失措 2021-01-17 14:25

I am using Hibernate latest version 4.3.5.Final.

My hibernate.cfg.xml file content:



        
12条回答
  •  礼貌的吻别
    2021-01-17 14:49

    // Create Configuration File and configure it.
        Configuration configuration=new Configuration();
        configuration.configure("com/sathya/config/emp.cfg.xml"); 
        // Create Service Registry
        ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
        // Create Session Object using SessionFactory Interface
        SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
        Session session=sessionFactory.openSession();
        // new StandardServiceRegistryBuilder().applySettings(new Configuration().getProperties());
        // Session session=new Configuration().buildSessionFactory(new StandardServiceRegistryBuilder().build()).openSession();
    

提交回复
热议问题