Why do I get this error when connecting to a remote db2 on a linux?
[IBM][JDBC Driver] CLI0615E Error receiving from socket, server is not responding. SQLSTATE=08S01
There is no problem when I access a remote db2 on AIX with the same piece of code.
import java.sql.*;
public class db2inst1 {
public static void main(String[] args)
{
try
{
//String url="jdbc:db2://<AIX>:6789/sample";
String url="jdbc:db2://<linux>:6790/sample";
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver"
;
Connection con=DriverManager.getConnection(url,"db2inst1","db2"
;
String mySQL = "select count(*) from staff";
Statement stmt = con.createStatement();
ResultSet set = stmt.executeQuery(mySQL);
while (set.next()) {
int ss = set.getInt(1);
System.out.println(ss);
}
set.close();
stmt.close();
con.close();
}catch (Throwable e)
{
System.out.println(e.getMessage());
}
}
}
Thanks all experts in advance.
Please help.
gyhlee
[IBM][JDBC Driver] CLI0615E Error receiving from socket, server is not responding. SQLSTATE=08S01
There is no problem when I access a remote db2 on AIX with the same piece of code.
import java.sql.*;
public class db2inst1 {
public static void main(String[] args)
{
try
{
//String url="jdbc:db2://<AIX>:6789/sample";
String url="jdbc:db2://<linux>:6790/sample";
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver"
Connection con=DriverManager.getConnection(url,"db2inst1","db2"
String mySQL = "select count(*) from staff";
Statement stmt = con.createStatement();
ResultSet set = stmt.executeQuery(mySQL);
while (set.next()) {
int ss = set.getInt(1);
System.out.println(ss);
}
set.close();
stmt.close();
con.close();
}catch (Throwable e)
{
System.out.println(e.getMessage());
}
}
}
Thanks all experts in advance.
Please help.
gyhlee