rospcc
asked on
JDBC Oracle connection in java
I have connection to Oracle database in ASP. Now, I have problem converting to the connection to use JDBC in java. Please help shed some light.
Oracle Connection in ASP
-------------------------- ----
strConn ="DRIVER={Oracle in OraHome90};DSN=<DSN>;DBQ=< DBQ>;UID=< user name>;PWD=<password>;"
Set conntemp = Server.CreateObject("ADODB .Connectio n")
if conntemp.state=0 then
conntemp.Open strConn
My attempt in JDBC
---------------------
String driver = "oracle.jdbc.driver.Oracle Driver";
Class.forName(driver);
DriverManager.registerDriv er(new oracle.jdbc.driver.OracleD river());
Connection con = DriverManager.getConnectio n("jdbc:or acle:thin: @(descript ion=(addre ss=(host=< host name>)(protocol=tcp)(port= <port>))(c onnect_dat a=(sid=<si d>)))",<us er name>,<password>);
When i run the connection in java, i get IOException : The network adapter could not establish the connection.
Is it because i specify the host name wrongly?
thanks
Oracle Connection in ASP
--------------------------
strConn ="DRIVER={Oracle in OraHome90};DSN=<DSN>;DBQ=<
Set conntemp = Server.CreateObject("ADODB
if conntemp.state=0 then
conntemp.Open strConn
My attempt in JDBC
---------------------
String driver = "oracle.jdbc.driver.Oracle
Class.forName(driver);
DriverManager.registerDriv
Connection con = DriverManager.getConnectio
When i run the connection in java, i get IOException : The network adapter could not establish the connection.
Is it because i specify the host name wrongly?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also you need in CLASSPATH variable the Oracle classes for connection to the database.