I am new to Oracle, and am trying to run a simple example code with Java, but am getting this error when executing the code.. I am able to start up the listener via CMD and am also able to run SQL Plus. Can anyone give me a hand and tell me what I might be doing wrong?
Update: I am using JDBC.
Database is local, and I actually had it working but it stopped working just today. I'm not really sure why though. Would you mind giving me some procedures to follow by since I don't know much.
Restart it with the "lsnrctl start" command or on a Windows OS by starting the listener service. Ensure the correct hostname is specified in listner. ora. Add the hostname and IP address in the hosts file located under C:\Windows\System32\drivers\etc folder.
Incorrect Details: Make sure that the connection details have been entered properly. The Hostname, Port, Username, and password need to be entered correctly in order to establish the connection. If any of these values aren't entered properly, the error might be triggered.
This error usually means that one of host, port, sid/service is wrong, or there is a network issue. What is the hostname or IP address of the server where the database is running?
First check the tnsnames. ora file and ensure that it points to the correct server and port. If the Forms server is on another machine, test the TNS resolve with tnsping from the command prompt. Finally, check the listener.
Either:
(This strange error message is produced by Oracle's JDBC driver when it can't connect to the database server. 'Network adapter' appears to refer to some component of their code, which isn't very useful. Real network adapters (NICs) don't establish connections at all: TCP protocol stacks do that. It would have been a lot more useful if they had just let the original ConnectException
be thrown, or at least used its error message and let it appear in the stack trace.)
I had the same problem, and this is how I fixed it. I was using the wrong port for my connection.
private final String DB_URL = "jdbc:oracle:thin:@localhost:1521:orcll"; // 1521 my wrong port
(my localhost address) : https://localhost:1158/em
login
Below 'General' click on LISTENER_localhost
Edit you connection change port 1521 to 1522.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With