When I did this, I did like this:
First put sqlite3.exe in the src / main / resources folder - now sqlite3.exe will be in the jar file as a resource file. Then copy sqlite3.exe (from the JAR) to system32 (if it is not windows and sqlite):
try {
CopyFromJar fileManager = new CopyFromJar();
fileManager.copyFile(new File("C:\\Windows\\System32\\sqlite3.exe"), "/sqlite3.exe");
} catch (IOException e) {
ErrorFrame.showException(e);
}
-, sqlite-jdbc .
, , :
// Path to database - if first time, then database.db will created in folder with program
private static final String pathToDatabase = "jdbc:sqlite:database.db";
//..................
// Loading JDBC driver
Class.forName("org.sqlite.JDBC");
// Create connection
Connection con = DriverManager.getConnection(pathToDatabase);
Statement stat = con.createStatement();