- 博客(15)
- 收藏
- 关注
原创 docker创建mysql容器中文乱码问题
创建容器到修改字符集步骤:创建容器进入容器内部进入mysql查看字符编码查看数据如下,查出的数据中,名字和性别字段为乱码。修改配置文件先退出mysql]进入到配置文件目录删除my.cnf配置文件将mysql.conf.d中的文件复制到/etc/mysql/中,并命名为my.cnf查看现在的内容,主体如下添加几行配置退出容器,重启容器。查看数据。字符集已经更改。完成。...
2021-07-09 10:40:59
168
原创 jdk动态代理
知识温故:jdk动态代理以下是自己的小理解做的大概原理图。被代理对象实现的接口:public interface UserDao { int add(int a,int b); int getId(int id);}被代理对象:public class UserDaoImpl implements UserDao { @Override public int add(int a, int b) { return a+b; }
2021-05-29 17:00:16
92
原创 jdbc操作mysql
首先在mysql可视化工具中创建表,添加初始数据(可不加)。在idea创建新模块,添加相关依赖。<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</
2021-05-28 17:56:09
96
原创 TCP连接传输对象
首先创建要传输的对象。@Data@ToString@AllArgsConstructor@NoArgsConstructorpublic class Book implements Serializable { int id; String name; String author;}创建TCP传输服务端。/** * 对象流传输服务端 */public class SocketObjServer { @Test public void test1
2021-05-27 15:53:51
438
原创 对象序列化与反序列化
需要被序列化的对象。@Data@ToString@AllArgsConstructor@NoArgsConstructorpublic class Book implements Serializable { int id; String name; String author;}序列化代码。@Test public void test9() throws IOException{ File file = new File("D:\\aaa.
2021-05-25 15:24:45
122
原创 io流对文件夹的整个复制
代码如下,未考虑空文件夹。public void test6(File file) throws IOException { File[] files = file.listFiles(); for(File file1:files){ if (file1.isDirectory()){ test6(file1); }else{ FileInputStream f
2021-05-25 00:09:34
66
原创 IO流实现文件和目录复制
代码实现复制功能。@Test public void test1() throws IOException { File file = new File("D:\\BaiduNetdiskDownload\\a.txt"); FileInputStream fis = new FileInputStream(file); FileOutputStream fos = new FileOutputStream("D:\\a.txt");
2021-05-24 20:35:12
167
原创 java日历类使用
java的日历类完成一些常用功能。/** * 这周星期六是几号 */ @Test public void test3(){ Calendar instance = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); instance.set(Calendar.DAY_OF_WEEK,Calendar.SATUR
2021-05-24 19:57:27
105
原创 docker拉取rabbitmq3.7.14
今天学到springcloud的bus,也顺便学了docker。所以把docker拉取rabbitmq的过程记录一下,中间遇到许多问题,都一一解决,最终访问成功。首先拉取rabbitmq:[root@xsh rabbitmq]# docker pull rabbitmq:3.7.14查看当前镜像:[root@xsh rabbitmq]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZErabbitmq
2021-03-25 22:41:03
455
原创 关于@SpringCloudApplication
今天发现@SpringCloudApplication整合了好几个注解,可以省去一些注解。@Target({ElementType.TYPE})@Retention(RetentionPolicy.RUNTIME)@Documented@Inherited@SpringBootApplication@EnableDiscoveryClient@EnableCircuitBreakerpublic @interface SpringCloudApplication {}标注在Sprin
2021-03-23 12:10:20
338
原创 关于微服务往Eureka注册
今天发现微服务注册Eureka客户端,其实不用需要添加@EnableEurekaClient注解<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>添加yml配置文件即可
2021-03-22 23:32:01
203
原创 关于File()中的pathname的路径
由于学习javase时不够认真,现在得再补一下Io流的知识。public static void main(String[] args) throws IOException { File file = new File("333.jpg"); //这里是读取不到文件的 FileInputStream inputStream = new FileInputStream(file);}上面是一个main方法以上方法中pathname直接填了文件名。是相对路径,但m
2021-03-03 20:53:13
2970
2
原创 关于父工程的依赖管理<dependencyManagement>
使用父工程对项目依赖进行管理时。应该遵循以下结构<dependencyManagement> <dependencies> <dependency> </dependency></dependencyManagement>最顶层为依赖管理标签,该标签是父工程对依赖管理的核心。...
2021-02-27 19:45:04
348
原创 关于@SpringBootApplication中@ComponentScan的范围
SpringBoot主启动类上添加的@SpringBootApplication注解中包含的注解@Target({ElementType.TYPE})@Retention(RetentionPolicy.RUNTIME)@Documented@Inherited@SpringBootConfiguration@EnableAutoConfiguration@ComponentScan( excludeFilters = {@Filter( type = FilterType.C
2021-02-26 15:48:06
536
原创 ## 关于Spring-Cloud的Eureka启动时异常
刚学习Spring-Cloud,没想到刚起步就遇到异常Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2021-02-25 21:46:29.962 ERROR 7344 --- [ main] o.s.boot.SpringApplication : Application ru
2021-02-25 22:09:59
227
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人