org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.ri,该如何处理
org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.ri,该如何处理
日期:2014-05-17 浏览次数:20779 次
org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.ri 大侠请指教那里有错啊 Exception in thread "main" org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.river at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:79) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:425) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339) at com.bjsxt.hibernate.TestStudent.main(TestStudent.java:14) Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.river at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192) at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84) ... 8 more hibernate不是自带有mysql连接吗?
------解决方案-------------------- Exception in thread "main" org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.river 没有导入MYSQL的JAR文件 啊. 把它导入就可以了啊. 谁说的hibernate自带了???