portable database location

This commit is contained in:
Matthew Slowe 2020-05-29 14:10:58 +01:00
parent 4043fbd1e6
commit d6cb2c15d7

View File

@ -30,7 +30,7 @@
Collections.sort(words); Collections.sort(words);
Connection conn = DriverManager.getConnection( Connection conn = DriverManager.getConnection(
"jdbc:sqlite:" + getServletContext().getInitParameter("sqlite_db")); "jdbc:sqlite:" + getServletContext().getRealPath("/WEB-INF/files/database.sqlite"));
PreparedStatement stmt = conn.prepareStatement( PreparedStatement stmt = conn.prepareStatement(
"INSERT INTO grids (remotehost, input, size_x, size_y, simple) VALUES (?, ?, ?, ?, ?)", "INSERT INTO grids (remotehost, input, size_x, size_y, simple) VALUES (?, ?, ?, ?, ?)",
Statement.RETURN_GENERATED_KEYS); Statement.RETURN_GENERATED_KEYS);