Je n'arrive pas a me connecter a oracle via eclipse

Fermé
dev_8118 Messages postés 1 Date d'inscription mercredi 1 juillet 2020 Statut Membre Dernière intervention 1 juillet 2020 - 1 juil. 2020 à 18:00
Bonjour, ça fait quelque temps déjà que j'essaye de me connecter a ma base de donnée via eclipse mais j'ai toujours cette erreur

java.sql.SQLRecoverableException: Erreur d'E/S: The Network Adapter could not establish the connection

j'ai essayer plusieurs codes mais aucun ne semble marcher, j'ai aussi vérifiée listener.ora et tnsnames.ora pour confirmer (port number et SID) mais ça ne semble pas être le problème
voici mon code:

package application;
import java.sql.*;

public class monInterface {

public static void main(String[] args) {

try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCLSYS","system","TPBDD");
Statement st=con.createStatement();
String sql="select * from film";
ResultSet rs=st.executeQuery(sql);

while(rs.next())
System.out.println(rs.getInt(1)+" "+rs.getString(2));
rs.close();
}
catch (Exception e) {
System.out.println(e);

}}}


and the listener.ora:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\App\db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\App\db_home\bin\oraclr19.dll")
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

and the tnsnames.ora:

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
PS: j'utilise oracle 10g et java se 8
si quelqu'un pour bien m'aider pour régler ce problème.