I'm creating a java application that connects to a Firebird database and retrieve some data. The program is done, and it runs well in my computer. The problem is that, in the computer I need to run the application, the database is in another computer in the local network and I have no idea of which path should I put into the connection string of jaybird to get it running. Let me explain a bit:
I need to run my application in a computer X, but the actual database is not in a drive in the computer, but in a computer in the local network. Something like this (this is an example, and its reproduced at my home, not at the actual site I need to get it to work):
So the path that it gives me for the database is something like:
I know that if my database is in my drive ( for example, in C:\Users\john\Desktop ), my connection to the database using Jaybird should be something like this:
static final String FB_DB_URL = "jdbc:firebirdsql://localhost:3050/C:\\Users\\john\\Desktop\\TEST1.FDB";
FB_connection = DriverManager.getConnection( FB_DB_URL , FB_USER , FB_PASS);
static final String FB_DB_URL = "jdbc:firebirdsql://192.168.0.101:3050/\\\\DESKTOP-1UFA09I\\Documents\\TEST1.FDB";
static final String FB_DB_URL = "jdbc:firebirdsql://192.168.0.101:3050/C:\\users\\john2\\Documents\\TEST1.FDB";
To connect to a remote database you need to know the following things:
You seem to have the first three items covered, so the problem is with the fourth. You think the database is located in C:\users\john2\Documents\TEST1.FDB. If that is the case, then the JDBC url is:
However, the user running the Firebird server process by default has no access to user folders for security reasons.
I suggest that you move the database to a location outside of the user folder, and make sure the account running the Firebird server service has read and write access (NETWORK SERVICE or LOCAL SYSTEM, I forgot which and I currently don't have access to Windows machine) .