Eclipse cannot connect oracle 10g XE on windows 7

2020-03-08 04:27发布

问题:

Eclipse is not able to connect to oracle 10g it is giving errors like:

Could not connect to New Oracle.
Error creating SQL Model Connection connection to New Oracle. (Error: Io exception: Got minus one from a read call)
Io exception: Got minus one from a read call
Error creating jdbc.connection.name connection to New Oracle. (Error: Io exception: Got minus one from a read call)
Io exception: Got minus one from a read call

But it is opening the database page normally. I can create tables, insert, etc.

My url is http://localhost:8080/apex.

I used the following connection settings in Eclipse:

  • SID: XE
  • Host: localhost
  • Port no: 8080
  • Username: system
  • password: 123
  • Connection url: jdbc:oracle:thin:@localhost:8080:XE

I have also started all Oracle services from services.msc.

How can I fix these errors?

回答1:

Port 8080 is not for the Oracle database itself, it is for viewing Oracle Application Express (Apex) via a web browser.

I'm guessing you want Eclipse to connect to the database itself, so your JDBC URL should use port 1521 instead of 8080:

 jdbc:oracle:thin:@localhost:1521:XE


回答2:

Here is the answer. To fix this Go to SQL prompt type in "LSNRCTL SERVICES" this gives you a block of code look for "PORT=XXXXX" key word. its not always 1521. mine port '49160' instead of 1521 (surprisingly).

use : "jdbc:oracle:thin:@localhost:XXXXX:ORCL";