Yes but for Android solutions, the use of local network will greatly limit them, so if you want a user to communicate with your app in this case, you need to open a port again.
Actually, no, I don't. My phone/app is communicating with SQL server exposed on that network.
And those instances of SQL server being exposed on that network is a requirement for all computers to run on that network. That applies to MySQL, or any database server. I mean, if the database server is not exposed to the local network, then how can any of the workstations run their software such as accounting systems etc. that consume their data from that database. So on a LAN (local area network), then in my experience, such database servers have ALWAYS been open to any connection from any workstation.
In the case then of adopting the jtds drivers and directly connecting from Android? I did not have to open up anything, or configure anything different then the typical need + requirement that ANY database server would and does require.
And I can EASY use the app off site (but i don't need to). How? Why of course you run a VPN. After all, all a VPN is allow workers on the road or at home to simply become part of that network. Once you do this, (connect with VPN), then zero changes to my B4A software is required. The IP address of the SQL server simply works. So I can connect with great ease. As long as the phone has some kind of VPN software then using WI-fi or the data plan? The connection to the database server works seamless.
So sure, while the database server needs ports open? Well, they quite much do in all cases if any other computers, workstations etc. on that network is going to use that instance of sql server.
So, I just wanted to point out that no extra or specials ports have to be open for such direct connections. But of course in all cases from workstations say using Excel to pull data from SQL server or whatever? Well, yes, that database has to be exposed to the network. So having to open ports applies to any and all database servers, and if no such ports are open, then most desktop software not going to be able to use that sql server instance on that network.
I have found that if SQL server is up and running on that network, and you using SQL server logons (as opposed to windows authentication logons), then the jtds drivers with B4A work seamless, and NO additional configuration of the network, or the server or anything is required. All that is required is that B4A running on the phone be part of that network and it can use that IP address of the SQL server in question. And as noted, if you have VPN setup (and most companies do), then if you have a supported VPN client on your android? Launch that first - connect. Now my B4A app again connects directly to the SQL server - no extra ports, or even any setup on the phone side, or the server side + network is or will be required. The only requirement is that your phone is part of the LAN - and a VPN will solve this requirement.
Having stated all the above? I only used a direct connection since the direct connection time I use is VERY small, and often not even once a day. I have a sqlite local database, and my software works against that. I then wrote a sqlite to sql server sync set of routines (they handle PK/FK and the issues of autonumber PK keys between phone side and server side. New updates, new records added sql server side thus sync down to client side, and any new updates, changes, additions on the client side are synced up to sql server. So this is a bi-directional sync. i find that the sync takes less then 2 seconds, and as noted, I only need to do this once a day, or even once every 2-3 days. So perhaps you mean the phone has to open its connection to talk to the sql server - but my application is not constantly doing this - and for apps that require a constant pull of information from a server? Then jtds direct is a VERY bad idea, and is not all that reliable. So in this case - yes, having a port open not really the problem, but having a open direct connection all the time is MOST certainly a problem. They time out - many other issues.
As noted, hosted SQL systems often restrict by IP address. So you in those cases have to use a VPN to appear that your connecting from your work IP address/location.
R
Albert