Access mssql server on w2K side?

Discussion in 'Parallels Desktop for Mac' started by cathyf, Apr 11, 2007.

  1. cathyf

    cathyf Bit poster

    Messages:
    7
    I have a java app that runs on the mac (macbook pro, macosx 10.4, win2000 run in the parallels VM) and I connect via IP address and port number (3700) to a microsoft sql server running on the win2000 desktop on my desk. But I would like to be able to run the app when the laptop and I are not at the office, and connect to the (as far as I know) identical microsoft sql server running on the win2000 virtual machine on the laptop. I tried the obvious things -- in TCP/IP filtering on the (w2K) control panel all the ports are shown as open, and I tried it with the "Enable TCP/IP filtering (all adaptors)" ticked both on and off.

    I'm not even sure whether this is an error or not -- if I type
    Code:
    ssh 10.0.3.216 -p3700
    or
    Code:
    telnet 10.0.3.216 3700
    I get a 'connection refused' -- is that what I should expect, or what?
     
  2. Jochen

    Jochen Bit poster

    Messages:
    6
    Hi cathyf,

    hmm, I just tried this out with SQLServer2000 on XP running in Parallels 3188 using the latest Microsoft JDBC drivers on Mac side. I did an ipconfig in a command window on the XP side and got my emulated system's IP. Then, I have set up the connection string using this IP and the default SQLServer port number 1433. Works excellent with the Northwind database.
    I got the driver from here:
    http://www.microsoft.com/downloads/...2C-0488-4E46-AFBF-ACACE5369FA3&displaylang=en
    and used following program
    public class JDBCTest {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

    Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://<your IP>:1433;DatabaseName=Northwind;user=sa;password=<your sa password>");

    final ResultSet resultSet = conn.createStatement().executeQuery("select * from Orders");

    while (resultSet.next())
    System.out.println("resultSet.getString(1) = " + resultSet.getString(1));
    }
    }

    Please replace the <your ...> sections in the connection string with your local values.

    HTH

    Ciao

    ...Jochen
     
  3. cathyf

    cathyf Bit poster

    Messages:
    7
    I just wanted to update this because I don't want anyone to become confused about there being some problem with mssql across the parallels environment. The problem was purely with our application -- it was ignoring the change that I made in the setup for which IP address to find the mssql server at.

    But anyway, using the windows guest os to host the mssql server works flawlessly. Just grab the IP address of the virtual machine, and it works like any other windows database server.
     

Share This Page