No, no intention to judge or say it bad.
We have a thread of 30 posts here now. I am trying to save world poverty and suffering. It is VERY sad that we have all these posts here, and yet the WHOLE point I was making?
In near 100% of the cases, you have SERVERNAME\SQLINSTANCE.
And even with the driver from Microsoft, you use above. (of course we replace server name with IP address).
And more so the Microsoft driver does not work.
However, in 99% of cases the #1 face plant problem is everyone types in the server instance for the connection as part of the server name. And I 100% understand why!
this is due to every other case when you connect to SQL server I can think of - from the Microsoft jtds driver, to odbc, to desktop .net, to asp.net and the list goes on an on?
You type in
servername\SQLINSTANCE name.
However, as noted the Microsoft driver don't work, so everyone still tends to use the source forge one.
So, like always?
We don't' need a book 100+ pages long here. We don't need long drawn out articles either. The KEY concept is that this one huge large exception simply needs to be packed away in one's memory bank.
that ONE simple issue?
You don't include the sql instance name as part of the server name. the sql instance is specified separate from the server name in the connection string.
This is key knowledge the reading public needs here. So, not being critical at all - just doing my best to note this elephant in the room.
Take a look at this recent post:
Android Question - Please help with example code... | B4X Rapid Application Development & Programming Tools
And in that post, I shared a "test" connection utility I wrote!.
Note what the poster did:
They shared a screen shot (the utility I wrote).
And guess what? Well, look at this:
See the problem? The users sql instance name is typed in with the server name!!! Again, what a sad waste of time and poor user experience this user encountered (that is sad to me!!!). In the above screen shot you can INSTANT see the users mistake! (and they guessed and typed in MSSQL for the server instance name - (wrong!!!). It is clearly COURTSENDB
Not being critical. Just another user (like in this thread) was asking why their connection to SQL server did not work.
So I am in no way dumping cold water on the jdbc driver. In fact I use this all the time with B4A, and it is a great choice.
Provided we don't have every 2nd or 3rd person trying to learn B4A, and walking away with a horrible and bad experience?
There is simply NO REASON for this endless parade of people having such a poor experiences in what should be simple and easy.
And one big reason is this SIMPLE advice I am giving here.
That advice is don't include the SQL instance as part of the server name. Once done, then you have multiple orders of a better chance that the connection will work.
you should not judge JDBC by the lack of capabilities it has running on Android.
If there is any statement, claim, hint, or any text I have here that suggests, hints, implies, advocates that I am somehow being judgmental or suggesting that this technology or the jdbc concepts are bad, or even lacking on Android? That certainly not my intention.
However, I will happy edit or change such text I have here or anywhere you can find if I have done so - not my intention.
I am in zero ways throwing cold water here or making some kind of judgment in the negative. Only try to reduce the suffering here!
In fact, I think the whole technology stack is rather amazing, and it quite easy and works rather well on Android + B4A.
I think we all suggest the web service based approach is better. However a good number of VERY handy scenarios in which a direct connect is not only easy, less work, but does not require any interaction with a web server, or to even have one, or to set one up!.
And in the last 1/2 dozen posts on connecting to sql server on B4A forms? They all been developers from VB6, .net etc., and simply expected the same concepts to work on Android. And in fact with direct connect, this does work. And in fact that's why i shared that simple little bit of code and that above form. The user can enter in the settings - touch connect. If it don't work, then they don't have to bother writing code or checking THEIR code!
Anyway, if there is any text here that seems to be critical of the jdbc drivers on Android? Please point it out - I will edit and change that text.
Regards,
Albert D. Kallal
Edmonton, Alberta Canada