title: Can't access a second MYSQL database wih Java
body: <p>Is there something specific to be aware of when connecting to a second MYSQL database in java?</p>
  
  <p>I query one database <code>db1</code> just fine, but when i switch to a duplicate database<code>db2</code> and run the same query
  When run in eclipse, the program just says "terminated"  with no output.</p>
  
  <pre><code>Class.forName("com.mysql.jdbc.Driver").newInstance();
                      Connection con = DriverManager.getConnection
      ("jdbc:mysql://localhost/db2", "root", "password");
                      con.setReadOnly(true);
                      Statement stmt = con.createStatement();
  
                      ResultSet res = stmt.executeQuery("query that worked for db1");
  
      //then do stuff with res that printed out the grabbed 
  //results successfully for db1`
  </code></pre>