// Path: src/database/DatabaseConnection.java
// public class DatabaseConnection {
// 	Connection dbConnection;
// 	
// 	public DatabaseConnection() {
// 		dbConnection = DatabaseConnection.connector();
// 	}
// 	
// 	public static Connection connector() {
// 		// SQLite connection string
//         Connection conn = null;
//         try {
//         	Class.forName("org.sqlite.JDBC");
//         	//for Linux distribution
//             String url = "jdbc:sqlite:/home/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//             
//         	//for Mac distribution
// //        	String url = "jdbc:sqlite:/Users/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//         	
//           //for Windows distribution
// //            String url = "jdbc:sqlite:Money_Manager.db";
//             
//             conn = DriverManager.getConnection(url);
// //            System.out.println("Connection to SQLite has been established.");
//         } catch (SQLException | ClassNotFoundException e) {
//             System.out.println(e.getMessage());
//         }
//         return conn;
// 	}
// 	
// 	
// 	public boolean isDBConnected() {
// 		try {
// 			return !dbConnection.isClosed();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 			return false;
// 		}
// 	}
// 	
// //	public static void main(String[] args) {
// //		DatabaseConnection access = new DatabaseConnection();
// //		System.out.println(access.isDBConnected());
// //	}
// }


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import database.DatabaseConnection;
		}
	}

	public int getSourceArraySizeForDashboard() {
		int size = 0;
		if (BankIssue.isbKashActivated() && BankIssue.isRocketActivated()) {
			size = getSourceArraySize() + 4;
		} else if (BankIssue.isbKashActivated()) {
			size = getSourceArraySize() + 3;
		} else if (BankIssue.isRocketActivated()) {
			size = getSourceArraySize() + 3;
		} else {
			size = getSourceArraySize() + 2;
		}
		return size;
	}

	public String[] getArchivedSourceList() {
		if (getArchivedSourceArraySize() > 0) {
			String list[] = new String[getArchivedSourceArraySize()];
			String sql = "SELECT sourceArchiveList \n" + "FROM Archived_Source_List";
			try (Connection conn = connector();
					Statement stmt = conn.createStatement();
					ResultSet result = stmt.executeQuery(sql)) {
				int index = 0;
				while (result.next()) {
					list[index] = result.getString("sourceArchiveList");
					++index;
				}
			} catch (Exception e) {
// Path: src/database/DatabaseConnection.java
// public class DatabaseConnection {
// 	Connection dbConnection;
// 	
// 	public DatabaseConnection() {
// 		dbConnection = DatabaseConnection.connector();
// 	}
// 	
// 	public static Connection connector() {
// 		// SQLite connection string
//         Connection conn = null;
//         try {
//         	Class.forName("org.sqlite.JDBC");
//         	//for Linux distribution
//             String url = "jdbc:sqlite:/home/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//             
//         	//for Mac distribution
// //        	String url = "jdbc:sqlite:/Users/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//         	
//           //for Windows distribution
// //            String url = "jdbc:sqlite:Money_Manager.db";
//             
//             conn = DriverManager.getConnection(url);
// //            System.out.println("Connection to SQLite has been established.");
//         } catch (SQLException | ClassNotFoundException e) {
//             System.out.println(e.getMessage());
//         }
//         return conn;
// 	}
// 	
// 	
// 	public boolean isDBConnected() {
// 		try {
// 			return !dbConnection.isClosed();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 			return false;
// 		}
// 	}
// 	
// //	public static void main(String[] args) {
// //		DatabaseConnection access = new DatabaseConnection();
// //		System.out.println(access.isDBConnected());
// //	}
// }


// Path: src/operation/ComboboxList.java
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import database.DatabaseConnection;

		}
	}

	public int getSourceArraySizeForDashboard() {
		int size = 0;
		if (BankIssue.isbKashActivated() && BankIssue.isRocketActivated()) {
			size = getSourceArraySize() + 4;
		} else if (BankIssue.isbKashActivated()) {
			size = getSourceArraySize() + 3;
		} else if (BankIssue.isRocketActivated()) {
			size = getSourceArraySize() + 3;
		} else {
			size = getSourceArraySize() + 2;
		}
		return size;
	}

	public String[] getArchivedSourceList() {
		if (getArchivedSourceArraySize() > 0) {
			String list[] = new String[getArchivedSourceArraySize()];
			String sql = "SELECT sourceArchiveList \n" + "FROM Archived_Source_List";
			try (Connection conn = connector();
					Statement stmt = conn.createStatement();
					ResultSet result = stmt.executeQuery(sql)) {
				int index = 0;
				while (result.next()) {
					list[index] = result.getString("sourceArchiveList");
					++index;
				}
			} catch (Exception e) {
				e.printStackTrace();