Skip to content

Commit 250d7be

Browse files
committed
Remove platform dependence in H2 database location
1 parent a140eab commit 250d7be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/owasp/webgoat/session/UserDatabase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
import java.sql.*;
44
import java.util.ArrayList;
55
import java.util.Iterator;
6+
import java.io.File;
67

78
class UserDatabase {
89
private Connection userDB;
9-
private final String USER_DB_URI = "jdbc:h2:userDatabase:./users";
10+
private final String USER_DB_URI = "jdbc:h2:" + System.getProperty("user.dir") + File.separator + "UserDatabase";
1011

1112
private final String CREATE_USERS_TABLE = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTO_INCREMENT, username VARCHAR(255) NOT NULL UNIQUE);";
1213
private final String CREATE_ROLES_TABLE = "CREATE TABLE IF NOT EXISTS roles (id INTEGER PRIMARY KEY AUTO_INCREMENT, rolename VARCHAR(255) NOT NULL UNIQUE);";

0 commit comments

Comments
 (0)