He probado a conectar de la misma forma en una clase java normal con un main.
Código:
public class Test {
public Test() {
super();
}
public static void main(String[] args){
try{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con =DriverManager.getConnection("jdbc:oracle:thin:@150....:1521/orc1","...","...");
Statement s = con.createStatement();
ResultSet result = s.executeQuery("select *from MRALOGIN");
while(result.next()){
System.out.println(result.getString(1));
}
}
catch(Exception e){
System.out.println(e.toString());
}
}
}
Pero el error es el mismo:
Código:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor