-2

I am trying to figure out how to connect to an oracle database located in sql developer, using java in eclipse. I have been looking online and have found responses like this one java connect to backend explanation which give a detailed step by step on how to connect.

However I was also reading about using PuttY/tunneling, which the link that I showed above does not talk about. How do I know if PuttY has to be used? For context, the oracle sql developer database is a database that belongs to my company

Abra
  • 19,142
  • 7
  • 29
  • 41
mchl45
  • 29
  • 6
  • [SQL Developer](https://www.oracle.com/database/technologies/appdev/sql-developer.html) is a database client and not a database. [PuTTY](https://en.wikipedia.org/wiki/PuTTY) is a terminal emulator. It appears to me you wish to write java code that will connect to an Oracle database. If that is correct, then why don't you use JDBC with Oracle's [JDBC driver](https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html) ? – Abra Jul 12 '19 at 22:06
  • Hi @Abra. Yes, I want to write java code to connect to an oracle database. The link I provided in my description also talks about JDBC. But is that the way to go? what about ssh tunneling? – mchl45 Jul 12 '19 at 23:19
  • I didn't see details of the Oracle version you are using in your post, but part of the documentation for every Oracle version is _JDBC Developer Guide_ which details how to connect to an Oracle database using JDBC. You don't need tunneling. – Abra Jul 13 '19 at 03:43

1 Answers1

1

Hypothetically, you could SSH tunneling if you want to connect to a server that is behind a firewall that blocks the database port, or on a private network that your network cannot route to.

Another possible use-case might be to provide an encrypted channel for your database connection to protect the data against snooping (or worse) by a third party. (But there better ways to do that; e.g. using a VPN, or an SSL connection to the database.)

Generally speaking, SSH tunneling of database connections is something you do when other approaches are not available or won't work.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216