|
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! ! ! ! ! ! ! ! |
|