LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem by connecting MS SQL from SuSE Linux (https://www.linuxquestions.org/questions/linux-newbie-8/problem-by-connecting-ms-sql-from-suse-linux-753058/)

thomas2004ch 09-06-2009 08:02 AM

Problem by connecting MS SQL from SuSE Linux
 
Hi all,

I installed the VMware on the host (Windows XP) and then installed a guest syste of SuSE Linux.

I wrote a java program which just try to connect to the MS SQL database installed on the host. I ran this program successfully on host.

But as I ran this program from on Linux, I got exception as follow.

I've made an exception by firewall to let the 192.168.174.1:1433 go through. But it doesn't help. Seems it's not really a problem of firewall?

Code:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 192.168.174.1, port 1433 has failed. Error: No route to host. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
        at java.sql.DriverManager.getConnection(DriverManager.java:620)
        at java.sql.DriverManager.getConnection(DriverManager.java:200)
        at com.weichen.app.App.main(App.java:36)


TB0ne 09-06-2009 08:41 AM

Quote:

Originally Posted by thomas2004ch (Post 3671761)
Hi all,

I installed the VMware on the host (Windows XP) and then installed a guest syste of SuSE Linux.

I wrote a java program which just try to connect to the MS SQL database installed on the host. I ran this program successfully on host.

But as I ran this program from on Linux, I got exception as follow.

I've made an exception by firewall to let the 192.168.174.1:1433 go through. But it doesn't help. Seems it's not really a problem of firewall?

[CODE]
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 192.168.174.1, port 1433 has failed. Error: No route to host. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
[CODE]

Might not be a firewall issue, but there definitely IS a network issue somewhere. Can you connect to the box via other ports, like telnet, ssh, ftp, etc.?? Can you ping the other host?? Did you install SElinux?

Also, VMware networking can be challenging. Can you get to the internet via Linux? Post the output of "iptables -L", if the networking things I mentioned are all working...

thomas2004ch 09-06-2009 08:56 AM

Quote:

Originally Posted by TB0ne (Post 3671803)
Might not be a firewall issue, but there definitely IS a network issue somewhere. Can you connect to the box via other ports, like telnet, ssh, ftp, etc.?? Can you ping the other host?? Did you install SElinux?

Also, VMware networking can be challenging. Can you get to the internet via Linux? Post the output of "iptables -L", if the networking things I mentioned are all working...

I can ping the host (Windows XP) from the Guest syste (SeSu Linux).

I can connect to the Guest from Host using putty.

I can open FireFox in Guest (Linux) and browse any internet.

I haven't installed SELinux. What is that?

The output of "iptables -L" looks as follow. But I wonder if I have to install the MS-SQL Client first?

Code:

linux-upve:/home/thomas2004ch/temp # cd
linux-upve:~ # iptables -L
Chain INPUT (policy ACCEPT)
target    prot opt source              destination

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination
linux-upve:~ #


chrism01 09-06-2009 08:23 PM

Taking TB0ne's qns
Quote:

Can you connect to the box via other ports, like telnet, ssh, ftp, etc.?? Can you ping the other host??
Try all those but connecting to the VM guest from the other (Suse) box. Which, if any, work?

thomas2004ch 09-07-2009 03:27 AM

I solved the problem now. It's a firewall issue. I set an xception in the Windows firewall for the Linux ip and it works.


All times are GMT -5. The time now is 11:07 PM.