title: Java inheritance error: "cannot find symbol"
body: <p>I am beginner to java!! I got <code>cannot find symbol</code> error in java. I google it but not found any satisfactory solution. Here is my <code>connect.java</code> class</p>
  
  <pre><code>public class connect
  {
      static String JDBC_DRIVER; 
      static String DB_URL;
      static String USER;
     static String PASS;
   public connect(){
      JDBC_DRIVER = "com.mysql.jdbc.Driver"; 
      DB_URL = "jdbc:mysql://localhost:3306/my_db";
      USER = "admin";
      PASS = "123";
   }
     public Connection openDbConnection(){
          Connection conn = null;
          try{
             Class.forName("com.mysql.jdbc.Driver");
             System.out.println("Connecting to database...");
             conn = DriverManager.getConnection(DB_URL,USER,PASS);
          }
          catch(SQLException se){
             se.printStackTrace();
          }
          catch(Exception e){
             e.printStackTrace();
          }
          System.out.println("successfully connected to db");
          return conn;
     }
  </code></pre>
  
  <p>And this is <code>query.java</code> class</p>
  
  <pre><code>public class query extends connect {
      Statement stmt;
      Connection connection;
      public query(){
          super();
          stmt = null;
          connection =null;
      }
  
      public void runquery(){
  
          connection=super.openDbConnection();
          System.out.println("Creating statement...");
          stmt = connection.createStatement();
          String sql;
          sql = "SELECT * FROM my_table";
          ResultSet rs = stmt.executeQuery(sql);
          while(rs.next()){
             int id  = rs.getInt("id");
             System.out.print("ID: " + id);
          }
      }
      public static void main(String[] args){
          query obj = new query(); 
          obj.runquery();
      }   
  }
  </code></pre>
  
  <p>When i compile query.java through terminal <code>javac query.java</code>, i got error:</p>
  
  <pre><code>public class query extends connect {
                             ^
    symbol: class connect
  src/database/query.java:22: error: cannot find symbol
          connection=super.openDbConnection();
                     ^
    symbol:   variable super
    location: class query
  2 errors
  </code></pre>
  
  <p>both classes are in same directory. Can any one help me to fix this error???</p>