How to write a relative path for SQLite connection in java?

262 Views Asked by At

I am setting up an SQLite connection in Java in Netbeans. When I am writing the absolute path in the connection.java file, it works just fine. How do I write this as a relative path so that I can share the project with others as well?

Connection conn = DriverManager.getConnection("jdbc:sqlite:/Users/sparshbohra/Desktop/214/214-project/src/baby/pluto/RoomBookingDatabase_V1.1.db");

This is what the folder looks like:

enter image description here

I am getting an error when I use the following link as a path: "jdbc:sqlite:/RoomBookingDatabase_V1.1.db"

0

There are 0 best solutions below