JDBC Connectivity Issues

#1

using JDBC

JDBC.usedriver(“ojdbc8.jar”)
JDBC.init()

conn = DriverManager.getConnection(“jdbc:oracle:thin:@HOST_NAME:PORT:SERVICE_NAME/user=USERNAME,password=PASSWORD”)

JavaCall.JavaCallError(“Error calling Java: java.sql.SQLException: Listener refused the connection with the following errors:\nORA-12505, TNS: listener does not currently know of SID given in connect descriptor\n”).

I cannot find much documentation about fixing this issue within the package. Although I know it is because I am using a service name as opposed to a SID.

Any assistance would be tremendous.

Thanks,

James

#2

Does the equivalent Java code (ie, with the same connection string) work?

#3

I ended up playing with the connection string:

JDBC.DriverManager.getConnection(“jdbc:oracle:thin:@HOST_NAME:PORT/SERVICE_NAME”, Dict(“user” => “USERNAME”, “password” => “PASSWORD”))

This ended up connecting to my Oracle Database.

Thanks for reaching out.