facebook

What is the Syntax for specifying a password in a URL?

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #249115 Reply

    Ghazalawahid
    Member

    How can i specify a password of my local database in a url below?

    url = “jdbc:mysql://localhost:3306/Northwind”;

    #249129 Reply

    Haris Peco
    Member

    Ghazalawahid ,

    try

    url = “jdbc:mysql://localhost:3306/Northwind?user=YOUR_USERNAME&password=YOUR_PASSWORD”;

    see http://dev.mysql.com/doc/refman/5.0/en/cj-configuration-properties.html for complete url syntax

    Regards

    #249179 Reply

    Ghazalawahid
    Member

    My code for Database access is :

    String driver = “com.mysql.jdbc.Driver”;
    String url = “jdbc:mysql://localhost:3306/Northwind”;
    String username = “”;
    String password = “ghazala”;

    But having error :

    String driver = “com.mysql.jdbc.Driver”;
    String url = “jdbc:mysql://localhost:3306/Northwind”;
    String username = “”; // No username/password required
    String password = “ghazala”; // for desktop access to MS Access.
    showEmployeeTable(driver, url, username, password);

    ” Error with connection: access denied for user ‘ ‘@’ localhost’

    #249180 Reply

    Ghazalawahid
    Member

    I have pasted the code twice in above question,hope its understandable.

    #249190 Reply

    Haris Peco
    Member

    Ghazalawahid ,

    You can’t access to MS Access with mysql driver

    Regards

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: What is the Syntax for specifying a password in a URL?

You must be logged in to post in the forum log in