Hibernate Dialect must be explicitly set解决方案一
?? ? ? ?用以下这种方式获得SessionFactory工厂
?? ? ? ?public static SessionFactory factory = null;
static{try {Configuration config = new Configuration();factory = config.configure().buildSessionFactory();} catch (Throwable e) {e.printStackTrace();System.err.println("Hibernate的配置文件不正确"); new ExceptionInInitializerError(e);}}
?
?? 出现Hibernate Dialect must be explicitly set的原因是由于在上面代码部分你写成以下
?? ?factory = config.configure().buildSessionFactory();
?