I want to make a working program written in Java on Mac available to a Windows user, but the connection fails on Windows with a strange error message indicating Windows is looking for the DB in C::\windows\system32
. The SQLite DB is located in the same folder as the Java program:
Connection conn = DriverManager.getConnection("jdbc:sqlite:Databasess/Logic1.sqlite");
I've made a JAR and put it in a folder called Aurora
, so it looks like this:
TeachingMachine
Aurora.v2.jar
Images
Audio
databases
Logic1.sqlite
Logic2.sqlite
Transfer the entire folder to another Mac and it works perfectly. Transfer the same folder to my HP running Windows10 and it immediately gives me an error that I had copied from my HP to my Mac:
JAVA.SQL ‘SQLEXCEPTION: path to ’databases/Logic1.sqlite’: C:\windows\system32:’databases’ does not exist
I've searched for pleas for help regarding windows\system32
, and larger portions of the error message. I've found some people whose questions involved gremlins in their code for making a connection to SQLite or other databases, but nothing so far mentioning the problem I've outlined here.
There is a folder for system32
on my Windows PC, but I'm trying for a single program that I can maintain and distribute to people running various operating systems. It would be self-defeating to have to copy my databases into system32
.
This is the same basic code for connecting I've been using for over a year. There is, of course, no mention of system32
.
Connection conn = null;
try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:databases/Logic2.sqlite");
return conn;
}catch (Exception e)
The expected results are what I get on any Mac that I've tried it on, and the actual result when I run the same code on Windows 10 is that I only get one error message.