h2初始化小技巧
发表于|更新于
|浏览量:
居不幽者志不广,不愁者思不远。——冯梦龙
今天在
https://github.com/apache/incubator-streampark/pull/3759/files
看到一个小技巧
主要就是这里
1 | "jdbc:h2:file:%s;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true;INIT=runscript from 'classpath:db/schema-h2.sql'" |
我发现可以使用
1 | INIT=runscript from 'classpath:db/schema-h2.sql' |
拼接在url后面
这样在h2初始化时可以自动执行相关脚本,非常nice
相关推荐
2022-03-02
image-comparison
人活在世,不过一场美丽的寄居。——简嫃曾 我们可以使用image-comparison来在java中进行两个文件的对比: 项目地址:https://github.com/romankh3/image-comparison 它会自动生成对比后带红框的对比图,还能返回这些正方形的信息 首先引入GAV: 12345<dependency> <groupId>com.github.romankh3</groupId> <artifactId>image-comparison</artifactId> <version>4.4.0</version></dependency> 使用: 123456789//load images to be compared: BufferedImage expectedImage = ImageComparisonUtil.readImageFromResources("expected.png"); ...
2020-07-20
mysql使用ORDER BY和GROUP BY
今天写代码时遇到一个需求是这样的: 取表内最新的一条数据,根据用户名分组 本来以为又是那种需求,然后就开始写sql,写完一运行,报错。。。 然后发现GROUP BY必须放在ORDER BY的前面 但这样又会导致不能取最新的一条数据 于是用了一个“子查询”的办法解决 1234567891011121314<select id="cowBeer" resultType="map" parameterType="map"> SELECT [字段] FROM ( SELECT DISTINCT [字段] FROM [表名] AS msg, [表名] AS user WHERE [条件] ORDER BY [创建时间字段] DESC ) r GROUP BY r.[分组条件] ORDER BY r.[创建时间字段] DESC </select>
2022-11-11
filterTree递归树过滤实现
二人同心,其利断金;同心之言,其臭如兰——《周易·系辞上》 引入依赖: 123456<!-- https://search.maven.org/artifact/io.github.vampireachao/stream-query --><dependency> <groupId>io.github.vampireachao</groupId> <artifactId>stream-core</artifactId> <version>${stream-query-version}</version></dependency> 使用: 1234567891011121314151617181920212223242526272829303132333435363738394041424344@Test void testFilterTree() { List<Student> studentTr...
2023-12-21
Hutool-通过Lambda结缘开源到6.0探索之路
花开如火,也如寂寞。——顾城 分享自己参加ITPUB的开源小秀场
2024-03-27
stream-query开源合规
不好的书也像不好的朋友一样,可能把你戕害。——菲尔丁 首先是检查header的github action的ci 123456789101112131415161718192021222324252627282930313233343536373839404142# Licensed to the Apache Software Foundation (ASF) under one# or more contributor license agreements. See the NOTICE file# distributed with this work for additional information# regarding copyright ownership. The ASF licenses this file# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with...
2023-09-19
file4j
鲸落海底,哺暗界众生十五年。——加里·斯奈德 代码仓库 官方文档 在 SpringBoot 中通过简单的方式将文件存储到 本地、FTP、SFTP、WebDAV、谷歌云存阿里云OSS、华为云OBS、七牛云Kodo、腾讯云COS、百度云 BOS、又拍云USS、MinIO、 AWS S3、金山云 KS3、美团云 MSS、京东云 OSS、天翼云 OOS、移动云 EOS、沃云 OSS、 网易数帆 NOS、Ucloud US3、青云 QingStor、IBM COS 等平台 12345<dependency> <groupId>cn.xuyanwu</groupId> <artifactId>spring-file-storage</artifactId> <version>1.0.3</version></dependency>
