商品详情大图

网站搭建高防服务器租用企业高防服务器mybatis链接数据库出错

及时发货 交易保障 卖家承担邮费

商品详情

网站搭建高防服务器租用 企业高防服务器mybatis链接数据库出错

高防服务器租用 请联系:锐辉网络--小敏 :.........................................2853898501

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 
### Error getting a new connection.  Cause: java.sql.SQLException: No suitable driver found for jdbc\:mysql\://192.168.100.251\:3306/wbj_bus?useUnicode\=true&characterEncoding\=UTF-8
### Cause: java.sql.SQLException: No suitable driver found for jdbc\:mysql\://192.168.100.251\:3306/wbj_bus?useUnicode\=true&characterEncoding\=UTF-8
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getConnection(DefaultSqlSession.java:222)
at cn.itcast.javaee.mybatis.util.MybatisUtil.main(MybatisUtil.java:75)
Caused by: java.sql.SQLException: No suitable driver found for jdbc\:mysql\://192.168.100.251\:3306/wbj_bus?useUnicode\=true&characterEncoding\=UTF-8
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
atorg.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:181)
atorg.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:176)
atorg.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:80)
atorg.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:371
at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:80)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:131)
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:58)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getConnection(DefaultSqlSession.java:220)
... 1 more

一开始认为是驱动出的错(数据库驱动不对),不过显然不是。
后来将jdbc.url=jdbc\:mysql\://192.168.100.251\:3306/wbj_bus?useUnicode\=true&characterEncoding\=UTF-8中的转义字符去掉,变成:
<property name="url" value="jdbc:mysql://192.168.100.251:3306/wbj_bus?useUnicode=true&amp;characterEncoding=UTF-8"/>
再次执行就连接成功!
log4j:WARN See #noconfig for more info.
连接成功

下一条:高品质阿拉斯加犬幼犬、精心繁育品质优良
东莞市锐辉网络有限公司为你提供的“网站搭建高防服务器租用企业高防服务器mybatis链接数据库出错”详细介绍
东莞市锐辉网络有限公司
主营:高防服务器,服务器托管
联系卖家 进入商铺

高防服务器租用信息

进店 拨打电话 微信