Home » RDBMS Server » Networking and Gateways » oracle in vmware JDBC problem (Oracle/JDBC/VMWare, 10g/4/6, XP)
icon11.gif  oracle in vmware JDBC problem [message #298701] Thu, 07 February 2008 03:51
anandchakru
Messages: 1
Registered: February 2008
Junior Member
Hi Virtual folks, I installed Oracle in VMWare running XP. (My Firewall is disabled in both host and gues system) In my host i run eclipse and have sticked on to everything JDBC documentation says. I'm able to ping my guest from host.

C:\Documents and Settings\Chakru>ping sweety2
Pinging sweety2 http://192.168.224.129 with 32 bytes of data:

Reply from 192.168.224.129: bytes=32 time<1ms TTL=128
Reply from 192.168.224.129: bytes=32 time<1ms TTL=128
Reply from 192.168.224.129: bytes=32 time<1ms TTL=128
Reply from 192.168.224.129: bytes=32 time=1ms TTL=128

Ping statistics for 192.168.224.129:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
I'm even able to access guest's oracle's isqlplus in my host's Browser using this URL:


http://192.168.224.129:5560/isqlplus/


But when my Java program throws the following error:


java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:382)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:342)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:388)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:622)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at CreateCoffees.main(CreateCoffees.java:22)

For the following program:


import java.sql.*;
public class CreateCoffees {
public static void main(String args[]) {
String url = "jdbc:oracle:thin:@192.168.224.129:1521:orcl";
Connection con; Statement stmt;
String selectString = "Select * from Employees";
try {
Class.forName("oracle.jdbc.OracleDriver");
} catch (java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
con = DriverManager.
getConnection("jdbc:oracle:thin:@192.168.224.129:1521:orcl", "usr", "a123");
stmt = con.createStatement();
ResultSet rrs = stmt.executeQuery(selectString);
while (rrs.next())
System.out.println(rrs.getString(1));
stmt.close();
con.close();
} catch (SQLException ex) {
//System.err.println("SQLException: " + ex.getMessage());
ex.printStackTrace();
}
}
}


Any Clue What the Problem is?


Any help appreciated, Thanks
  • Attachment: scrsht.JPG
    (Size: 214.15KB, Downloaded 171 times)
Previous Topic: Listener not starting
Next Topic: i cant connect my oracle server. there are host problems.
Goto Forum:
  


Current Time: Fri Oct 31 17:25:45 CDT 2014

Total time taken to generate the page: 0.14037 seconds