springboot连接mysql数据库获得数据(4)

版权声明:随便看,喜欢的话加我qq,一起讨论。 https://blog.csdn.net/qq_43687284/article/details/84774853

1,新建一个项目,项目结构
在这里插入图片描述
2,编写配置文件一定要注意红线部分,没有的话会包时区错误。
在这里插入图片描述
3,编写controller 代码,
在这里插入图片描述
4,完成后启动测试,在地址栏写localhost:8080/q
在这里插入图片描述
结束语,可以看到已经获得数据库的数据了,说明springboot连接mysel成功。

猜你喜欢

转载自blog.csdn.net/qq_43687284/article/details/84774853
今日推荐