B4J Question [SOLVED] Is it possible to Running JRDC2 via tunnel

incendio

Well-Known Member
Licensed User
Longtime User
Hi guy,

Just like the title, is it possible?

I have a configuration file like this :
B4X:
DriverClass=org.firebirdsql.jdbc.FBDriver
JdbcUrl=jdbc:firebirdsql://localhost:3050/my_db?charSet=utf-8
ServerPort=18000
Debug=true

That configuration worked well caused there is firebird database listening on port 3050 on the same machine.

But if I change listening port to this
B4X:
JdbcUrl=jdbc:firebirdsql://localhost:3250/my_db?charSet=utf-8

where 3250 is a port that my application tunnel listen, it won't work.

EDIT
===
It worked, turn out that in my code there was code that still point to a local firebird port. After changed it, it worked OK.

Note that database path must be use symbolic name that described in database.conf in firebird server, absolute path won't worked
B4X:
JdbcUrl=jdbc:firebirdsql://localhost:3250/my_db?charSet=utf-8  ' must be set like this

JdbcUrl=jdbc:firebirdsql://localhost:3250/home/dba.fdb?charSet=utf-8  'won't work
 
Last edited:

WebQuest

Active Member
Licensed User
Longtime User
🔍 The Problem
When you changed the listening port to 3250 and tried to use a full absolute path like:
B4X:
JdbcUrl=jdbc:firebirdsql://localhost:3250/home/dba.fdb?charSet=utf-8
…it didn’t work. That’s because Firebird does not allow access to databases via absolute paths in many configurations (for security reasons), especially if DatabaseAccess is set to None or Restricted in the firebird.conf.
🎯 The Solution
You switched to using an alias defined in your databases.conf file like:
B4X:
my_db = /home/dba.fdb
And then used:
B4X:
JdbcUrl=jdbc:firebirdsql://localhost:3250/my_db?charSet=utf-8
This works because my_db is a symbolic name that Firebird recognizes internally — even over a tunnel or non-standard port.
 
Upvote 0
Top