Re: JDBC URL
Thufir wrote:
What I was trying to ask about was what the database server receives,
within the context of JDBC. That is, when the database, in this case
MSSQL, receives the URL of something like:
jdbc:microsoft:sqlserver://<host>:<port>;user=<USER>;password=<PW>
does the database only know that it's a JDBC connection because that
URL specifies a scheme of JDBC? Or, is there additional information
in the connection which, if not present, would cause sqlserver [sic] to
reject the connection as not JDBC?
The database does not receive that URL. Furthermore, the database
does not "know" that it is receiving a JDBC connection as opposed to
some other kind. All the database knows is that it receives a
connection. The fact that it's JDBC, ODBC or whatever matters only on
the client end.
It is the *client* that uses the URL to locate the database resource
(hence the "Locator" in "URL"). Once the (Java) client locates the
database via the URL, it communicates directly with the resource.
Analogously, let's say you want to go to Aunt Mathilda's house for
Christmas pudding. You can look up her address (the "URL" for
residences) on a paper map, on Google Earth, on MapQuest, or by
calling Uncle Bob for directions. To each of these locator mechanisms
you pass the "URL" of "1313 Mockingbird Lane" and they respond with
directions to get there. From that point you get in your Mini and you
buzz on over to Aunt Mathilda's house. She has no clue whether you
used the latitude and longitude of her house or her street address or
a drunkard's walk to get there, nor whether you asked Google Earth or
Uncle Bob.
So SQL Server is not rejecting your connection because it's not JDBC,
any more than Aunt Mathilda refused to let you in because Uncle Bob
wasn't the one to give you the directions. She called the police on
you because she didn't recognize you and you didn't give her the right
information about why you're there or who you are. Those errors in
turn came about because you specified the wrong location and/or
admission information. Either you went to Aunt Mathilda's neighbor's
house by mistake, or you forgot to bring the fruitcake, or you shaved
your beard and you never told her.
--
Lew