JDBC adapter cannot log into named instance of SS2008R2

  • Hi All;

    We have an application that uses JDBC adapters to connect to our SQL Server 2008R2 Standard databases. We added a Development application environment, and added a new SQL instance (servername\DEV) on the same physical box. When I point the JDBC adapter at the DEV SQL instance and try to connect, I get an error: 'Cannot open database "databasename" requested by the login. The login failed'. The DEV instance has the same database names and user as the default instance. If I change the JDBC connection in the DEV environment to point to the default instance, it connects properly.

    The port for the default instance is 1433, and the named instance is using the default TCP Dynamic Ports. Do I need to change to a static port to allow the JDBC adapter to be able to login?

    Thanks

  • I have it connecting if I use port 53390 - SQL's default Dynamic port. But, I'm still wondering if this could be a problem downstream sometime - do the dynamic ports change? Am I better off assigning another port number to the instance?

  • I think you will be better using a static port. I have seen it work better with JDBC to use a static port when dealing with named instances.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Any recommendations on port number?

  • Nope. I have used different ports.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I'm not sure that a static port is strictly needed here.

    JDBC tests the dynamic port for named instances using the SQL Server Browser service, which listens on UDP 1434. The browser response arrives from UDP 1434 and must be intercepted by the java program that instanciates the JDBC driver. Hence, java.exe (or UDP 1434) must be added to firewall exclusions.

    Then, again, if you are using a static port you can work around any firewall restriction and everything will work just fine.

    -- Gianluca Sartori

  • Jason, Gianluca - thanks for the input. Since my JDBC adapter is successfully logging in via the 53390 port now, I may leave it that way for the time being and see if any problems arise. This being a DEV environment, it does not have to be ironclad at this point.

  • Good luck.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply