Unless they are exposed to the public (or LAN), which from a security standpoint is a poor idea, the database does not have a URL in the same manner that a web page does (e.g.
http://somesite.com/webstuff/index.html). Typically, and in order to be useful, the database will accept "connections". These connections can be on a TCP port, such as MySQL which listens on port 3306, or it can be a UNIX inter-process communication port. Now, if the server has exposed its listening SQL port, you would be able to access it via the address or domain name. The dynamic web language being used, such as PHP, will have functions that allow it to connect to the database and pass information to the database in the query and receive the result set from the database, again as an example, the PDO library from PHP.
SQL Injection tries to create user input that when passed to the database changes the statements that are sent to the database to create a query different from the one the user intended. This recent LQ thread demonstrates an example of this:
http://www.linuxquestions.org/questi...on-4175412976/
As you can see in the example, the SQL injection adds an apostrophe (') to short circuit the intended statement and convert into one that returns the list of user names and passwords. It does not require the URL of the database.
If this explanation doesn't help or address your question, would you please try to elaborate on what you are trying to do, perhaps with an example?