会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132463个问题

麻烦老师帮我看下为什么报错。

log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver 

### The error may exist in com/bjsxt/pojo/mapper/employee2mapper.xml

### The error may involve com.bjsxt.pojo.mapper.employee2mapper.selectall

### The error occurred while executing a query

### Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver 

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:135)

at com.bjsxt.pojo.dao.impl.employee2impl.selectall(employee2impl.java:22)

at com.bjsxt.pojo.test.Test.main(Test.java:12)

Caused by: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver 

at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.initializeDriver(UnpooledDataSource.java:244)

at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:223)

at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:219)

at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:95)

at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:432)

at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:89)

at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:139)

at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:61)

at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337)

at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86)

at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)

at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)

at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)

... 4 more


Process finished with exit code 1

mybatisdemo.zip


JAVA 全系列/第六阶段:项目管理与SSM框架/Mybatis 5881楼
JAVA 全系列/第一阶段:JAVA 快速入门/控制语句、方法、递归算法 5884楼
JAVA 全系列/第六阶段:项目管理与SSM框架/Mybatis 5885楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/手写服务器项目(旧) 5886楼

net_shop.rar

显示不了图片,但是上一节还能显示

QQ图片20220518211915.png


Python 全系列/下架-第十二阶段:Python_大型电商项目(5天后下架)/Django项目阶段-电商项目(旧) 5889楼
Python 全系列/第一阶段:Python入门/编程基本概念 5892楼
JAVA 全系列/第七阶段:生产环境部署与协同开发/Linux 5893楼

object2.zip

怎么schoolName不是null,这个也是静态属性啊

image.png

JAVA 全系列/第二阶段:JAVA 基础深化和提高/IO 流技术(旧) 5895楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637