I am getting the exception ORA-12504, TNS:listener was not given the SID in CONNECT_DATA Could you please help me on this what went wrong? tnsnames.ora
SUNRISEDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SUNRISEDB)
)
)
listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = pacdcinfoddpodbc.cable.comcast.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\kkumar003c
and my java code is
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
dbConn = DriverManager.getConnection("jdbc:oracle:thin:@147.191.10.119:1521","KIRANDB","KIRANDB");
System.out.println();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("db connection=="+dbConn);
}