title: How to access a java Derby database? I could really do with a few helpful pointers
body: <p>I am new to using Derby and databses in eclipse, and I have become a tad lost and in need to a bit of help. I have established a database connection, created a new database, and a new schema, within which I have some tables containing some test data. I don't have any problem with the sql queries to select the relevant data. The problem I have is getting to a point where I can use queries. I am trying to create a class which connects to the database, and for testing purposes, uses a simple query to select some data. This is what I have so far:</p>
  
  <pre><code>public void getExerciseInfo() {
      try {
          Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
          connect = DriverManager.getConnection("jdbc:derby://localhost/c:/TestDatabase");
          PreparedStatement statement = connect.prepareStatement("SELECT * from TESTSCHEMA.TESTTABLE");
  
          resultSet = statement.executeQuery();
          while (resultSet.next()) {
              String name= resultSet.getString("NAME");
              String type = resultSet.getString("TYPE");
              System.out.println(name);
              System.out.println(type);
          }
  
      } catch (Exception e) {
  
      } finally {
          close();
      }
  }
  </code></pre>
  
  <p>All I am trying to do is output the data in the table to the console, but I cant even do this simple task :( Im guessing my connection url is invalid, is it supposed to be the file path to the database folder in my eclipse workspace?</p>
  
  <p>Anyhow, I am very lost, and any help would be greatly appreciated.</p>