Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007

    Unanswered: How do I determine the URL to the database?

    I have installed and created local MySQL test databases and tables on my Windows 7 PC. In order to connect to the database in Java, I need the parameters of the DriverManager getConnection API which includes the username and password and the URL to the database.

    How do I determine the URL to the database?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    A URL is a Uniform Resource Locator) and can be:-
    an IP address (but that only works if the IP address is fixed), allocating an IP address using DHCP by definition is dymnamic IE variable so you cannot rely on it)
    a hostname, that hostname you be a fully qualified name:- such as
    //mycomputer/ it depends on what or how your network is set up. it could be the system / computer name (as identified in the control panel / system and security / system)
    if the MySQL server is running on the same computer as you are trying access it from then you can use the 'locahost' synonym, LOCALHOST (or its IPv4 equivalent
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2009
    San Sebastian, Spain
    In your case you will be accessing it via localhost ( The default port for MySQL is 3306. Looking at an example of such a connection in Java

          conn = DriverManager.getConnection(
                       "jdbc:" + this.dbms + "://" +
                       this.serverName +
                       ":" + this.portNumber + "/",
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts