简体   繁体   English

在java中从sql-file将模式加载到h2中

[英]Load schema into h2 from sql-file in java

I have a sql-file containing several statements like this: 我有一个包含几个语句的sql文件,如下所示:

create table user (
name varchar(255) not null,
active INTEGER default 1 not null,
valid_from DATETIME not null,
valid_to DATETIME not null,

primary key (name));

I would like to re-use this already existing file for test-purposes. 我想将这个已经存在的文件用于测试目的。

How can I load this from Java into H2 to create a new schema? 如何将这个从Java加载到H2中以创建新模式?

There are 3 options: 有3种选择:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM