diff --git a/src/de/katho/kBorrow/Settings.java b/src/de/katho/kBorrow/Settings.java index 617176b..80d111a 100644 --- a/src/de/katho/kBorrow/Settings.java +++ b/src/de/katho/kBorrow/Settings.java @@ -82,7 +82,6 @@ public class Settings { System.out.println("I couldn't find the specified properties file while trying to create a default config."); e.printStackTrace(); } catch (IOException e) { - System.out.println(this.filePath); System.out.println("I had problems, writing to the properties file while trying to create a default config."); e.printStackTrace(); } @@ -94,5 +93,19 @@ public class Settings { public void setProperty(String pKey, String pValue){ this.properties.put(pKey, pValue); + + OutputStream os; + try { + os = new FileOutputStream(this.filePath+"/"+this.fileName); + this.properties.store(os, null); + + os.close(); + } catch (FileNotFoundException e) { + System.out.println("I couldn't find the specified properties file while trying to write the config."); + e.printStackTrace(); + } catch (IOException e) { + System.out.println("I had problems, writing to the properties file while saving a setting."); + e.printStackTrace(); + } } } diff --git a/src/de/katho/kBorrow/db/sqlite_init.sql b/src/de/katho/kBorrow/db/sqlite_init.sql new file mode 100644 index 0000000..eff183a --- /dev/null +++ b/src/de/katho/kBorrow/db/sqlite_init.sql @@ -0,0 +1,30 @@ +CREATE TABLE article ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + description TEXT +); + +CREATE TABLE lender ( + id INTEGER PRIMARY KEY, + name TEXT, + surname TEXT, + student_number INT, + comment TEXT +); + +CREATE TABLE user ( + id INTEGER PRIMARY KEY, + name TEXT, + surname TEXT +); + +CREATE TABLE lending ( + id INTEGER PRIMARY KEY, + article_id INT, + user_id INT, + lender_id INT, + start_date DATE DEFAULT current_date, + expected_end_date DATE, + end_date DATE, + comment +);