Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Commit

Permalink
Added Project Planner
Browse files Browse the repository at this point in the history
  • Loading branch information
Neopect committed Sep 5, 2020
1 parent 41f99f0 commit 68ca5b7
Show file tree
Hide file tree
Showing 9 changed files with 726 additions and 123 deletions.
19 changes: 18 additions & 1 deletion Tigris Auxilium/src/mainFolder/common/SqliteConnection.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mainFolder.common;


import java.sql.*;

import javax.swing.JOptionPane;
Expand All @@ -8,10 +9,26 @@ public class SqliteConnection {
Connection conn = null;
//String path = this.getClass().getClassLoader().getResource(<ProjectPlanner>).toExternalForm();
public static Connection dbConnector() {

String fullPath;
String OS = RWJsonUser.osName;

if (OS.equals("Windows 10") || OS.equals("Windows 8") || OS.equals("Windows 7")) {
fullPath = "C:\\Test\\TA\\Data\\ProjectPlanner.sqlite";

} else {

String paths = System.getProperty("user.home");
//System.out.println(paths);

fullPath = paths + "/TA/Data/ProjectPlanner.sqlite";
//System.out.println(full);
} //FIXME Needs to load all data first than work

try {
Class.forName("org.sqlite.JDBC");
// FIXME Copy file to new host. Make create file script in data folder
Connection conn = DriverManager.getConnection("jdbc:sqlite:C:\\Users\\user\\Desktop\\ProjectPlanner.sqlite"); // /home/tyler/Documents/ProjectPlanner
Connection conn = DriverManager.getConnection("jdbc:sqlite:"+fullPath); // /home/tyler/Documents/ProjectPlanner | jdbc:sqlite:C:\\Users\\user\\Desktop\\ProjectPlanner.sqlite | "jdbc:sqlite:" + fullPath
JOptionPane.showMessageDialog(null, "Connection Successful");
return conn;
}catch(Exception e) {
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Tigris Auxilium/src/mainFolder/resources/Test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Files test transfper
Loading

0 comments on commit 68ca5b7

Please sign in to comment.