java.sql.SQLException: No suitable driver found for jdbc:mysql
来源:互联网 发布:matlab 矩阵元素赋值 编辑:程序博客网 时间:2024/05/16 12:52
这两天在做项目的过程当中,遇见一个这样的问题,就是hibernate配置完成了之后,报 java.sql.SQLException: No suitable driver found for jdbc:mysql。。。。这样的一个错误。
刚开始的时候使用的是jdk1.8 + strust2 + hibernate5 可是怎么修改都不对,用静态mian方法启动时没问题,但是换成web程序启动访问的时候就开始报各种各样的错误。
这两天搞的我焦头烂额,丝毫没有思路。于是在网上找了一些解决方案,包括一些例子,将工程调整为 jdk1.8 + hibernate4 但是问题依旧,
使用main方法进行测试hibernate的时候没问题,web程序访问action的时候开始有问题。所以说我的配置是没有问题的,
熬到凌晨3.00 终于在一片博文中找到了一个以前用过的解决方式,重点是以前用过的方式!!!!!!!!!!
这个是令我很郁闷的,以前遇到过相似的问题,我竟然没想起来,白白耽误了我两天多的时间,实在是不值得啊!!!
下面开始正解:
尝试着将mysql-connector-java-3.1.14-bin.jar的jar包加入C:\Program Files\Java\jre1.6.0_02\lib\ext文件夹下,问题解决了!!
对,就是这么简单。
图就不上了,感谢
http://www.blogjava.net/w2gavin/articles/217864.html 这位朋友的博文,给我提了个醒~~~
另:
今天出现编码出现了No suitable driver found for jdbc,又是找遍了网上的资料,基本上都说是三个问题:
一是:连接URL格式出现了问题(Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/XX","root","XXXX")
二是:驱动字符串出错(com.mysql.jdbc.Driver)
三是Classpath中没有加入合适的mysql_jdbc驱动
经过我的仔细检查,这三种错误我都没有犯,为什么呢?
尝试着将mysql-connector-java-3.1.14-bin.jar的jar包加入C:\Program Files\Java\jre1.6.0_02\lib\ext文件夹下,问题解决了!!
原来是不仅仅要求将驱动加入classpath中,而且需要将该jar包加入到java运行环境的外部jar包中
- java.sql.SQLException: No suitable driver found for jdbc:mysql
- java.sql.SQLException: No suitable driver found for jdbc:mysql
- java.sql.SQLException: No suitable driver found for jdbc:derby
- mondrian java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/foodmart
- Jmeter java.sql.SQLException: No suitable driver found for jdbc:mysql:
- java.sql.SQLException: No suitable driver found for jdbc:mysql:/localhost/XXX?还是没有解决
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/airline
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/
- android studio下解决 java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/
- jdbc访问hive出现java.sql.SQLException: No suitable driver found for jdbc:hive的错误
- java.sql.SQLException: No suitable driver found for url
- java.sql.SQLException: No suitable driver found for
- java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://127.0.0.1:1433;解决
- java.sql.SQLException:No suitable driver found for "jdbc:oracle:thin:@
- Hibernate插件出现错误 java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver
- java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://127.0.0.1:1433
- 关于第一型曲面积分的再思考
- Hibernate配置模板
- 实体类配置文件模板
- 5. Your development and test sets 你的开发集和测试集(《MACHINE LEARNING YEARNING》翻译)
- Spring boot学习笔记 004
- java.sql.SQLException: No suitable driver found for jdbc:mysql
- 第二类曲面积分
- Leetcode在线编程single-number-ii
- Servlet的使用
- HDU-1688-Sightseeing
- 6. Your dev and test sets should come from the same distribution 你的开发集和测试集应该来自同一分布(《MACHINE LEARNING
- android中的SVG图像的各个属性意义
- 中国电科院招渗透测试工程师和逆向分析工程师
- 北航第十二届程序设计竞赛网络预赛题解