我下完MYSQL了 也安装了 但是没用啊 执行数据库操作发生异常:com.mysql.jdbc.Driver 这是提示的

默认分类 未结 1 1783
0糯米粑粑0
0糯米粑粑0 2023-03-21 17:44
相关标签:
1条回答
  • 2023-03-21 18:08

    &characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC username: root password: 123456 dbcp2: min-idle: 5 #数据库连接池的最小维持连接数 initial-size: 5 #初始化连接数 max-total: 5 #最大连接数 max-wait-millis: 200 #等待连接获取的最大超时时间

    做sql查询的时候,提示com.mysql.jdbc.Driver已经弃用了。

    Creating a new SqlSessionSqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5540e55e] was not registered for synchronization because synchronization is not activeLoading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver‘. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.2019-07-20 16:16:42.533 INFO 59084 --- [nio-8081-exec-2] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} initedJDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@366b8e6b] will not be managed by Spring==> Preparing: select * from user where id = ? ==> Parameters: 1(Integer)<== Columns: id, name, sex, age<== Row: 1, zhangsan, male, 22<== Total: 1Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5540e55e]

    mysql的驱动类com.mysql.jdbc.Driver过时了,需要用com.mysql.cj.jdbc.Driver代替

    标签:serveibatisutf-8matpremysselezhangXML

    一般情况下是你没有加载jdbc驱动包。或者你的数据库用户名密码不正确。

    你应该没有下载mysql jdbc驱动,把那个驱动下载后解压,再把其中的jar包复制到Tomcat下的lib文件夹下,并在环境变量classpath里添加该路径。 还有,你要确保mysql是否启动了。在终端窗口输入 net start mysql 回车,启动后会有提示。

    把问题写具体点呢,你用J***A访问数据库的?最好用ECLIPSE等集成开发环境来开发,这样可以直接把相应的jar包添加到环境中去。首先,你要下载mysql的jdbc驱动包,其次也可以设计环境变量把这个jar包添加到classpath中,最后才写具体的java代码进行测试,建议用eclipse开发环境,这样可以减少不少事情来自:求助得到的回答

    0 讨论(0)
提交回复