| |

VerySource

 Forgot password?
 Register
Search
View: 835|Reply: 2

Developed in Java language, but it has been unable to connect to the oracle database installed on the local computer, pl

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-10-3 23:00:01
| Show all posts |Read mode
Related code in Java:

Class.forName( "oracle.jdbc.driver.OracleDriver" );
conn = DriverManager.getConnection( "jdbc:oracle:thin:@LvQiang:1521:Oracle","SYSTEM", "zrc775fp")


The exception thrown:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:319)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:344)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:148)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)


I can be sure that the host name, port number, and database name are all correct, but why can't I connect to this one? I am using a router. In the router, I set the router's IP address as: 192.168.1.2, but after I changed LvQiang to this IP address, it failed! ! I don’t know why, the Oracle database I installed is version 9i, installed in the directory G:\Oracle9i on the computer, please give me some pointers, I am going crazy! ! ! ! ! ! ! !
Reply

Use magic Report

0

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-10-4 02:30:01
| Show all posts
Since it is a local machine, use localhost or use Ip to reduce network troubles, and your database name is Oracle
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-10-4 05:15:01
| Show all posts
LvQiang:1521:Oracle
Please check this carefully;
In addition, please use the best:
The IP address of the machine (Is 192.168.1.2 the IP address of your machine? You can also change LvQiang to 127.0.0.1): 1521 (unless you change the port number when you install Oracle): database name
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list