Error connection to Oracle database with DJBC driver

Posted by wer32 on 05-Mar-2015 04:49

Hi everybody

I have issue with datadirect driver connection to Oracle 12c via IPv4.

I have web application for tomcat. This application it trying to connect to database.

String driver = "com.asg.jdbc.oracle.OracleDriver";
String url = "jdbc:asg:oracle://usdenmsx3.asg.com:1521;ServiceName=orasun12";
String name = "tcitest";
String password = "tcitest1";

Class theClass = Class.forName(driver);

PrintWriter log = new PrintWriter(System.out, true);
DriverManager.setLogWriter(log);
DriverManager.registerDriver((Driver) theClass.newInstance());

Connection connection = DriverManager.getConnection(url, name, password);

This application is working properly and return Connection.

ALso I have another application whic is more complicated and has the same code. But second application is return an error
java.sql.SQLNonTransientConnectionException: [ASG][Oracle JDBC Driver]Error establishing socket to host and port: usdenmsx3.asg.com:1251. Reason: Connection refused: connect

How can I recognize what the problem with?

Posted by Raghu Chandra on 05-Mar-2015 04:55

Are you able to ping the machine 'usdenmsx3.asg.com' from your client?

It seems you are connecting to the port "1251". Is the port no. correct?

Error establishing socket to host and port: usdenmsx3.asg.com:1251

Thanks

Raghu.

All Replies

Posted by Raghu Chandra on 05-Mar-2015 04:55

Are you able to ping the machine 'usdenmsx3.asg.com' from your client?

It seems you are connecting to the port "1251". Is the port no. correct?

Error establishing socket to host and port: usdenmsx3.asg.com:1251

Thanks

Raghu.

Posted by wer32 on 05-Mar-2015 05:12

You are right. I just mixed 1251 and 1521. It works!

I'm very appreciate.

This thread is closed