解决:Property sqlSessionFactory or sqlSessionTemplate are required一问题描述:1.springboot项目启动报异常:如下图所示2.启动类配置如下图:3.application.properties文件已经配置过数据源二异常原因:项目有地方必须…
注意:String sql "select * from user where name like ?";template.query(sql,"%李%");错误写法:String sql "select * from user where name like %?%";String sql "select * from user where name like ?";template.query(sq…
手动配置数据源
① 不使用数据源
Test
public void test0() throws Exception {// 无非四个参数———驱动、数据库url、用户名、用户密码Class.forName("com.mysql.cj.jdbc.Driver");Connection connection DriverManager.getConnection("jdbc:mysql://loca…
解决:Failed to configure a DataSource: url attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver class一问题描述:(1)启动一个springboot程序…