Skip to content

Commit 41716a3

Browse files
committed
Added support for in-memory database option for H2 in the Database class
1 parent 2b8c598 commit 41716a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/javaxt/sql/Database.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ else if (vendor.equals("H2")){
412412
try{
413413
if (d==null) d = driver.load();
414414
if (d.getMajorVersion()>1){
415-
path = driver.getProtocol() + ":file:";
415+
if (host == null || host.trim().isEmpty() || host.equalsIgnoreCase("memory")) {
416+
path = driver.getProtocol() + ":mem:";
417+
} else {
418+
path = driver.getProtocol() + ":file:";
419+
}
416420
}
417421
}
418422
catch(Exception e){

0 commit comments

Comments
 (0)