Home > Archive > SQL Server JDBC > March 2006 > TCP/IP Connection - Can only connect to the 'Dynamic Port'









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author TCP/IP Connection - Can only connect to the 'Dynamic Port'
brad

2006-03-14, 1:23 pm

Hello,

I have TCP/IP enabled as a supported SQLExpress protocol.
There are three Active, Enabled IP addresses defined, and they are:
IP1: The DHCP assigned address on port 1433
IP2: The 'Default' localhost address (127.0.0.1) port 1432 (changed to this
by me)
IPALL (the dynamic port) currently assigned as 1132.

Using MS JDBC I am failing to connect with either timeout or connection
refused messages EXCEPT when using port 1132.

Using telnet, I am able to connect to ONLY the IPALL port of 1132.

I cannot figure this one out. MS QUERY works (ODBC). Any help.... ? Please.
Code follows:

------------
SQLServerDataSource ds = new SQLServerDataSource(
);
ds.setDatabaseName("PropertyStore");
ds.setServerName("FISH");
ds.setInstanceName("SQLEXPRESS");
ds.setUser("foo");
ds.setPassword("bar");
ds. setPortNumber(1132);
// the only port that works.
-----------

Thanks in advance.







David Browne

2006-03-16, 8:23 pm


"brad" <brad@discussions.microsoft.com> wrote in message
news:51CADB6F-BB36-41D9-8A55- F352DD2254E8@microso
ft.com...
> Hello,
>
> I have TCP/IP enabled as a supported SQLExpress protocol.
> There are three Active, Enabled IP addresses defined, and they are:
> IP1: The DHCP assigned address on port 1433
> IP2: The 'Default' localhost address (127.0.0.1) port 1432 (changed to
> this
> by me)
> IPALL (the dynamic port) currently assigned as 1132.
>
> Using MS JDBC I am failing to connect with either timeout or connection
> refused messages EXCEPT when using port 1132.
>
> Using telnet, I am able to connect to ONLY the IPALL port of 1132.
>


If SQL Server is listening on the port, then you will be able to telnet to
that port. Check the SQL Server logs, or run

select * from sys.tcp_endpoints

To see what addresses and ports SQL Server is listening on. And if you are
connecting directly to a port you shouldn't need the instance name. The
instance name is used by the browser service to find the dynamic port for
you.

David


brad

2006-03-16, 8:23 pm

David,

Thank you for the query. The results show that SQLEXPRESS is NOT listening
on the 1433 (or 1432) port. The results make a messy cut-n-paste, but shows
that two ports are being listened upon:

Dedicated Admin Connection
TSQL Default TCP

Both are started (state_desc = STARTED) and both are marked as dynamic
(is_dynamic_port = 1).

I know the obvious is that I have configured the protocols incorrectly, but
I do not think this is the case.

Using 'SQL Server Configuration Manager' and viewing the 'Protocols For
SQLEXPRESS' show that the ports listed below have properties "Active = Yes"
and "Enabled=Yes". This seems in direct contradiction of the query results.

Thank you for answering.




"David Browne" wrote:

>
> "brad" <brad@discussions.microsoft.com> wrote in message
> news:51CADB6F-BB36-41D9-8A55- F352DD2254E8@microso
ft.com...
>
> If SQL Server is listening on the port, then you will be able to telnet to
> that port. Check the SQL Server logs, or run
>
> select * from sys.tcp_endpoints
>
> To see what addresses and ports SQL Server is listening on. And if you are
> connecting directly to a port you shouldn't need the instance name. The
> instance name is used by the browser service to find the dynamic port for
> you.
>
> David
>
>
>

brad

2006-03-17, 3:23 am

It may be bad form to reply to ones own post, but I have now been able to
connect to port 1433 via JDBC (and telnet).

To do this, I had to:
- Open SQL Server configuration manager
- Open the TCP/IP Protocol Properties dialog under Network Configuration
- Under IPAll, TCP Port field, add 1433
- Restart SQLEXPRESS

As a further test, I added port 6666 to the TCP Port field and was then able
to connect to port 6666 (JDBC and telnet) even though this port was/is not
defined on the IP1, IP2 definitions given in the initial question.

The following SQL Server Books On Line article helped:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/8e955033-06ef-403f-b813-3d8241b62f1f.htm

Does not make sense to me...

-brad

"brad" wrote:
[color=darkred]
> David,
>
> Thank you for the query. The results show that SQLEXPRESS is NOT listening
> on the 1433 (or 1432) port. The results make a messy cut-n-paste, but shows
> that two ports are being listened upon:
>
> Dedicated Admin Connection
> TSQL Default TCP
>
> Both are started (state_desc = STARTED) and both are marked as dynamic
> (is_dynamic_port = 1).
>
> I know the obvious is that I have configured the protocols incorrectly, but
> I do not think this is the case.
>
> Using 'SQL Server Configuration Manager' and viewing the 'Protocols For
> SQLEXPRESS' show that the ports listed below have properties "Active = Yes"
> and "Enabled=Yes". This seems in direct contradiction of the query results.
>
> Thank you for answering.
>
>
>
>
> "David Browne" wrote:
>
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com