如果你和我一样从github或码云上下载了一个几年前别人写的demo代码,想用来做学习用.编译的时候遇到下面这样的错误,然后死命上网查各种方案,百试不灵.试尽了各种方案,就是还连接不上数据库.你可以试一下我经历了多么痛才领悟出来的方法: 有可能是引用的mysql-connector-java包和你安装的数据库不匹配啊!快去检查一下你MySQL Server版本吧. 引入与MySQL版本匹配的包 <dependency> <groupId>mysql</groupId>…
1. 首先删除 @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) 2. 在配置文件里添加完整的datasource属性 spring.datasource.url=jdbc:mysql://localhost:3306/mydatabase?verifyServerCertificate=false&useSSL=false&requireSSL=false spring.datasource.u…
Spring boot Unable to start embedded Tomcat 报错 java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName() 解决方法: 将Tomcat 安装目录下 的 servlet-api.jar 复制进 Jdk安装目录下的 /jre/lib/ext 下 问题解决…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
系列文章 Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs E…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Java Spring Boot VS .NetCore (三)Ioc容器处理 Java Spring Boot VS .NetCore (四)数据库操作 Spring Data JPA vs EFCore Java Spring Boot VS .NetCore (五)MyBatis vs EFCore…
项目中用到hbase,有时候可能会报一些异常,比如java.io.IOException: Unable to determine ZooKeeper ensemble 等等,当出现这个问题时,根据个人经验,是由于zookeeper集群地址不可访问导致的,但某某说是项目中用到线程池的问题导致的,咱就看看吧,异常信息如下: java.io.IOException: Unable to determine ZooKeeper ensemble at org.apache.hadoop.hbase.z…
技术说明: 源码下载:https://www.yuanmahy.com/8357.html 开发环境:jdk1.8,mysql5.7,node 9.4,redis6.2,npm6.9 开发工具:前端使用HBuilder.后端使用IntelliJ IDEA 后端使用Java Spring boot 框架 前端使用:Uniapp 开发 商家.骑手.司机端打包APP 用户端打包小程序 项目介绍: 外卖:  商家可入驻开店铺发布商品->用户下单购买商品->商家接单->骑手接单,进行配送. 跑腿:…
编写Java Spring Boot应用,通过配置logging.path路径把日志输出在指定的文件夹中. 第一步:通过VS Code创建一个空的Spring Boot项目 第二步:在application.properties中添加输入日志的级别和指定路径 logging.path=mylogs logging.level.root= INFO logging.level.org.springframework.web= INFO logging.level.org.springframewo…
参考官方例子:http://spring.io/guides/gs/relational-data-access/ 一.项目准备 在建立mysql数据库后新建表“t_order” ; -- ---------------------------- -- Table structure for `t_order` -- ---------------------------- DROP TABLE IF EXISTS `t_order`; CREATE TABLE `t_order` ( `ord…
在spring boot项目中,我们在pom.xml文件中添加了mysql和mybatis的依赖,我们常常遇到下面这样的问题: Description: Cannot determine embedded database driver class for database type NONE Action: If you want an embedded database please put a supported one on the classpath. If you have data…
一.新建Spring Boot 工程 特殊勾选数据库相关两个依赖 Mysql Driver — 数据库驱动 Spring Data JDBC 二.配置文件application.properties 中配置数据库信息即可 #testjdbc数据库连接信息 spring.datasource.username=root spring.datasource.password=root1234 spring.datasource.url=jdbc:mysql://localhost:3306/test…
一,为什么要使用druid数据源? 1,druid的优点 Druid是阿里巴巴开发的号称为监控而生的数据库连接池 它的优点包括: 可以监控数据库访问性能 SQL执行日志 SQL防火墙 但spring boot和shardingjdbc默认使用的数据库连接池是 HikariCP 如果要在shardingsphere中使用druid,需要在项目中整合后才能生效 2,druid的官方代码站: https://github.com/alibaba/druid/ 说明:刘宏缔的架构森林是一个专注架构的博客…
1.DataSource配置 1.1 默认配置application.xml spring.datasource.url=jdbc:mysql://localhost/test spring.datasource.username=root spring.datasource.password=****spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.type=com.zaxxer.hikari…
Spring boot 的maven设置阿里云仓库 打开根目录下的 pom.xml 文件,在对应为止出加入如下 红色 代码: <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin>…
1.DataSource配置 1.1 默认配置application.xml spring.datasource.url=jdbc:mysql://localhost/test spring.datasource.username=root spring.datasource.password=****spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.type=com.zaxxer.hikari…
一.实战项目介绍- JeeSite 基于Spring Boot 2.0 数据存储MySQL 语言:Java 规模大小:适中,适合初学者 源码地址:https://gitee.com/thinkgem/jeesite4 ,感谢原作者 本次项目演练地址:https://gitee.com/sfboy/iJeeSite4 ,在原作者的项目上,增加了Pipline持续集成的脚本,便于实战使用 二.环境准备 Spring Boot项目运行配置:MySQL+Java+Maven MySQL安装参考:http…
环境 jdk:1.8 framework: spring boot, sharding jdbc database: MySQL 搭建步骤 在pom 中加入sharding 依赖 <dependency> <groupId>io.shardingjdbc</groupId> <artifactId>sharding-jdbc-core-spring-boot-starter</artifactId> <version>2.0.3<…
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your testat org.springframework.util.Assert.state(Assert.java:70)at org.springframework.boot.test.c…
3.1   认识Srping Boot Spring Boot是一个框架,是一种全新的编程规范,它的产生简化了对框架的使用,简化了Spring众多的框架中大量的繁琐的配置文件,所以说Spring Boot是一个服务于框架的框架,服务范围是简化文件的配置. Spring Boot的核心功能: 独立运行的spring项目:可以以jar包的形式独立运行,通过Java -jar xx.jar来运行. 内嵌的servlet容器:可以选择内嵌的Tomcat.Jetty或者Undertow. 提供starte…
配置文件的管理 有的时候我们希望开发环境和测试环境的配置文件放在一起可以快速切换 spring boot 为我们提供了很方便的的选项 在 application.properties 中只需要添加属性 spring.profiles.active=dev 这样spring boot 就会切换选择 对应的配置文件 application-dev.properties,把里面的属性覆盖当前的配置文件 除此之外 @Profile({"dev"}) 注册的组件就会被扫描 这样非常适合调试 如果…
微服务系列 官方文档是最好的资料了. spring cloud官方文档:https://cloud.spring.io/spring-cloud-static/Greenwich.RELEASE/single/spring-cloud.html spring boot官方文档:https://docs.spring.io/spring-boot/docs/2.1.4.RELEASE/reference/htmlsingle/ dubbo官方文档: http://dubbo.apache.org/…