Solved issue #1 and started working on db structure.
This commit is contained in:
@@ -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.");
|
System.out.println("I couldn't find the specified properties file while trying to create a default config.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} 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.");
|
System.out.println("I had problems, writing to the properties file while trying to create a default config.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -94,5 +93,19 @@ public class Settings {
|
|||||||
|
|
||||||
public void setProperty(String pKey, String pValue){
|
public void setProperty(String pKey, String pValue){
|
||||||
this.properties.put(pKey, 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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
src/de/katho/kBorrow/db/sqlite_init.sql
Normal file
30
src/de/katho/kBorrow/db/sqlite_init.sql
Normal 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
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user