diff --git a/.gitignore b/.gitignore index 6cf4100..f35ad3a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ RESTaurant.iml classes/ src/main/java/META-INF/ dependency-reduced-pom.xml -!/requests.sqlite +history.sqlite +themes/ diff --git a/src/main/java/com/rohitawate/restaurant/util/history/HistoryManager.java b/src/main/java/com/rohitawate/restaurant/util/history/HistoryManager.java index 80b6fc3..36e5f3d 100644 --- a/src/main/java/com/rohitawate/restaurant/util/history/HistoryManager.java +++ b/src/main/java/com/rohitawate/restaurant/util/history/HistoryManager.java @@ -24,7 +24,7 @@ import com.rohitawate.restaurant.models.requests.GETRequest; import com.rohitawate.restaurant.models.requests.RestaurantRequest; import com.rohitawate.restaurant.util.json.JSONUtils; -import java.io.File; +import java.io.InputStream; import java.sql.*; import java.time.LocalDate; import java.util.Map; @@ -36,10 +36,10 @@ public class HistoryManager { public HistoryManager() { try { - conn = DriverManager.getConnection("jdbc:sqlite:requests.sqlite"); + conn = DriverManager.getConnection("jdbc:sqlite:history.sqlite"); // Read all queries from Queries.json - File queriesFile = new File(getClass().getResource("/sql/Queries.json").toURI()); + InputStream queriesFile = getClass().getResourceAsStream("/sql/Queries.json"); ObjectMapper mapper = new ObjectMapper(); queries = mapper.readTree(queriesFile);