I have a local MS Access database, and I'm trying to connect to it via Java. I'm using UCanAccess as the JDBC driver, and while the database is linked to a password protected database on a network drive, the one I'm connecting to has already been authenticated, and is not password protected itself. I have all of the dependencies in my classpath. When connecting, I keep getting this error:
java.lang.OutOfMemoryError: Java heap
I fired up Java VisualVM, and indeed, the main thread is eating up all 2GB of allocated memory. This has only ever happened to me when I tried to select a massive number of records from a large MySQL Database. I can't find any results on Google that relate to this happening upon connection, as I'm not even attempting to query the DB.
The code is simply:
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
System.out.println("Initiating connection...");
conn = DriverManager.getConnection("jdbc:ucanaccess://C:/Databases/StoreSalesCurrent.accdb");
System.out.println("Connection established");
conn.close();
Any idea why just trying to establish a connection would cause such large memory consumption?