B4J Question jRDC2 - external access (fix ip) with MS Sql Server

h725

Active Member
Licensed User
Longtime User
Hello everybody !

I have a question concerning the behaviour of the MS Sql Server.
I have the following constellation:
I have a fix ip adress. In the router there is a port forwarding for the
port to a computer in the local network. On the local computer I have
2 instances running. In the past I just checked the access with jRDC.
In:
Start -Programs -Microsoft SQL Server R2 -Configuration Tools - SQL Server Configuration Manager
one can check the settings concerning the instances and ports.
TCP Ip is activated. AND the default setting "monitor all" was activated.
jRDC2 is running fine.
BUT when I want to access the server with a VB Program and an sql connection I
have to uncheck "monitor all" to monitor all - no. Otherwise I do not get access
with the VB Program. In this cas (monitor all is disabled) the jRDC2 Server does not work.
It says: adress already in use - bind

Is there anybody who can help me with this problem ?

Thank you very much.

h725
 

h725

Active Member
Licensed User
Longtime User
I have attached the jRDC error message as an attachment (see addressinuse.png).

I have a b4a program on a handheld and a windows program for normal pcs accesssing the same database. I need both accessing the same database. Obviously it works fine in a local network, but when I try to access the DB through the web, it does not work.

I am using the following connection in my vb.net program:
connstring = "Data Source=" & My.Settings.connserver & ",1433" & ";" & "Network Library=DBMSSOCN;" & "Initial Catalog=" & My.Settings.conndatabase & ";" & "User Id=" & My.Settings.connusername & ";" & "Password=" & My.Settings.connpassword

In the jRDC2 config file I am using the following settings:

DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://192.168.178.235:1433/databasename;instance=instancename
User=sa
Password=xyz
ServerPort=1433

The settings in my MS SQL Server Configuration Manager are the following (see settingsserver.png)
 

Attachments

  • settingsserver.png
    settingsserver.png
    45.7 KB · Views: 318
  • addressinuse.png
    addressinuse.png
    66.9 KB · Views: 301
Last edited:
Upvote 0

h725

Active Member
Licensed User
Longtime User
Thank you very much Erel. Your information gave me the solution.
I would like to summarize how the solution works:

I just had to use another port for the "jRDC2" server in the B4A Program and in the "jRDC2" config file
for the serverport. Furthermore this second port had to be added to the port forwarding of the router.
That's it.


h725
 
Upvote 0
Top