Skip to content

Commit

Permalink
Made file paths OS independent
Browse files Browse the repository at this point in the history
  • Loading branch information
suushie_maniac committed Feb 16, 2016
1 parent a34d1ed commit 14c237d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/puzzletimer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Main() {
File databaseFile = new File("puzzletimerWCA.mv.db");
if (!databaseFile.exists()) {
try {
Connection connection = DriverManager.getConnection("jdbc:h2:./puzzletimerWCA");
Connection connection = DriverManager.getConnection("jdbc:h2:." + File.separator + "puzzletimerWCA");
Reader script = new InputStreamReader(
getClass().getResourceAsStream("/com/puzzletimer/resources/database/puzzletimerWCA.sql"));
RunScript.execute(connection, script);
Expand All @@ -77,7 +77,7 @@ public Main() {
// connect to database
Connection connection = null;
try {
connection = DriverManager.getConnection("jdbc:h2:./puzzletimerWCA;IFEXISTS=TRUE");
connection = DriverManager.getConnection("jdbc:h2:." + File.separator + "puzzletimerWCA;IFEXISTS=TRUE");
} catch (SQLException e) {
e.printStackTrace();
JFrame frame = new JFrame();
Expand Down

0 comments on commit 14c237d

Please sign in to comment.