Is it possible to load *.mdb database from a resource within a jar file?
Here is sample code but I end up with an error.
URL databaseResource = getClass().getResource("/resources/database.mdb"); String databasePath = databaseResource.toString(); String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+databasePath+";"; Connection connection = DriverManager.getConnection(database, "", ""); connection.close();
The error message that I get is this...
C:/Users/Development/Desktop/dist/Subscribers.jar!/resources/database.mdb
[Microsoft][ODBC Microsoft Access Driver] Not a valid file name.
Are there any ways around this?