Eclipse cannot connect oracle 10g XE on windows 7

Deadly 提交于 2019-12-19 04:49:15

问题


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";



来源:https://stackoverflow.com/questions/7055283/eclipse-cannot-connect-oracle-10g-xe-on-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!