Tasked with, and failing to, connect Java code to an Oracle 11.2 DB, that has TNS listeners disabled. The code is expected to be run on the same machine as the DB, so my understand is that the connection is possible
SQLPlus can connect locally, when given the correct user and password.
I won't add all of the code I've tried, but it looks largely like this (for now): How to connect JDBC to tns oracle. At this point, I'm just guessing at connection strings, with no luck.
While, I'm not certain it's pertinent, here is the tnsnames.ora structure.
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA = ...
ORACLR_CONNECTION_DATA = ...
[EDIT] Forgot to mention that there is existing .NET code that is able to make the connection. Not a .NET developer, but here is what I think is the relevant code.
Dim oConn As New OracleConnection
oConn.ConnectionString = String.Format("User id={0};Password={1};", "***", "***")
oConn.Open()
oConn.Close()