title: Netbeans and mysql communication
body: <p>I've created an application for our company. At first, I've tried to create without password on my database in MySQL-xampp and it works fine. Now my problem is I put a password on my database and my application is now throwing me this error whenever I log in:</p>
  
  <blockquote>
    <p>SQL java.sql.SQLException: Access denied for user
    'root'@'CITSP-MOB7'(using password: YES)</p>
  </blockquote>
  
  <p>I also get an error connecting my database:</p>
  
  <blockquote>
    <p>Unable to connect. Cannot establish a connection to
    jdbc:mysql//localhost:3306/mydb using com.mysql.jdbc.Driver (Access
    denied for user 'root'@'CITSP-MOB7' (using password: YES)).</p>
  </blockquote>
  
  <p>Here is my code for database connection:</p>
  
  <pre><code>static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
  static final String DB_URL = "jdbc:mysql://192.168.1.112:3306/citsp";
  static final String USER = "root";
  static final String PASS = "mypassword";
  
  try{
     Class.forName("com.mysql.jdbc.Driver");
    }catch(ClassNotFoundException ex){
              }
    //STEP 3: Open a connection
    System.out.println("Connecting to database...");
    conn = DriverManager.getConnection(DB_URL,USER,PASS);
  
    //STEP 4: Execute a query
    System.out.println("Creating statement...");
    stmt = conn.createStatement();
  </code></pre>
  
  <p>Can somebody help me to solve my connection problem?
  Your answer will be appreciated. Thanks in advance! :)</p>