Passing more tests
This commit is contained in:
parent
9425d585bf
commit
43668dc8d3
1 changed files with 6 additions and 3 deletions
|
@ -22,8 +22,8 @@ public class Database {
|
||||||
// "jdbc:sqlite:<filename>.sqlite3" to use a file-based database instead.
|
// "jdbc:sqlite:<filename>.sqlite3" to use a file-based database instead.
|
||||||
// Nore that ":memory:" is an **SQLite specific** magic string that tells the
|
// Nore that ":memory:" is an **SQLite specific** magic string that tells the
|
||||||
// underlying SQLite engine to store the database in memory.
|
// underlying SQLite engine to store the database in memory.
|
||||||
// private static final String jdbcString = "jdbc:sqlite::memory:";
|
private static final String jdbcString = "jdbc:sqlite::memory:";
|
||||||
private static final String jdbcString = "jdbc:sqlite:krusty.db";
|
// private static final String jdbcString = "jdbc:sqlite:krusty.db";
|
||||||
private Connection conn = null;
|
private Connection conn = null;
|
||||||
|
|
||||||
public String getCustomers(Request req, Response res) {
|
public String getCustomers(Request req, Response res) {
|
||||||
|
@ -34,11 +34,14 @@ public class Database {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRawMaterials(Request req, Response res) {
|
public String getRawMaterials(Request req, Response res) {
|
||||||
return "{}";
|
String result = selectQuery("ingredients", "raw-materials", "ingredient_name", "amount", "unit");
|
||||||
|
result = result.replaceAll("ingredient_name", "name");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCookies(Request req, Response res) {
|
public String getCookies(Request req, Response res) {
|
||||||
String result = selectQuery("recipes", "cookies", "recipe_name");
|
String result = selectQuery("recipes", "cookies", "recipe_name");
|
||||||
|
result = result.replaceAll("recipe_name", "name");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue