Trivadis / sqldev-jdbc-proxy

JDBC driver for SQL Developer that can delegate MySQL requests to Snowflake, PostgreSQL, SQLite, H2 and MySQL.
Apache License 2.0
16 stars 2 forks source link

Proxy driver for Oracle DB #6

Closed jjgrijalba closed 2 years ago

jjgrijalba commented 2 years ago

Dear Philip,

I am a security consultant which works in several IT projects.

I was reading and reviewing your project "sqldev-jdbc-proxy" which I see very interesting and simple to use. So congratulations for it, it is great!

I was wondering if you could help with a similar case I have, maybe your knowledge can be key in finding the solution of the problem.

In one of the projects in which I am involved, we need to build a proxy between SQL Developer and an Oracle DB. This use case is a litle bit different to the one your project covers, but I think we could use some of the principles you were using.

In my case, I am emulating an Oracle driver (oracle.jdbc.OracleDriver like in ojdbc8.jar) in a proxy driver I did, very similar to yours which will intercept the SQL queries from sql Developer.

To have it working, I copy it in sqldeveloper\jdbc\lib replacing the original driver ojdbc8.jar, then I add it as Third Party Driver in SQL Developer.

At the begining it works, due SQL Dev let me configure it as it was an Oracle driver, then when I try to connect, it contact this proxy driver sending the jdbc URL to connect.Until here everything is fine.

The issue comes when this proxy has to call the original Oracle jdbc driver ojdbc8.jar to stablish the real connection.

If I add ojdbc8.jar it in the classpath, then sql developer detect it first and bypass my proxy, if I put it in the classpath of the manifest file of the jar of the proxy driver, same behaviour, if I add it as a lib to add in the sqldeveloper.conf, same behaviour, etc.

I was wondering if you have any idea on how you think this could be fix.

Thanks! Kind regards

PhilippSalvisberg commented 2 years ago

IMO this question is a bit off-topic. I hope you understand that I cannot provide free support for other projects.

That said, I suggest to replace all occurrences of ojdbc.jar with your proxy. Furthermore you should ensure that the proxy and the real driver do not register the same class (see META-INF/services). It really depends on how the driver is loaded in SQL Developer. Maybe you have no choice than to patch the original ojdbc.jar files to make it work.

Good luck.