Solved issue #1 and started working on db structure.

This commit is contained in:
Servicepoint
2014-10-01 17:12:11 +02:00
parent 11597d1762
commit 081e7e98b5
2 changed files with 44 additions and 1 deletions

View File

@@ -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();
}
}
}

View File

@@ -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
);