cannot resolve symbol errors

Discussion in 'Java' started by Jody, Nov 15, 2004.

  1. Jody

    Jody Guest

    Hey, i'm having issues with the following code:
    package dbase;

    import java.util.Vector;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;


    public class Register extends DataBase
    {
    public Register()
    {

    }

    public Vector getBookLoansColumnHeadings()
    {
    Vector headings = new Vector();
    this.setConnection();
    try
    {
    Statement st = conn.createStatement();
    String sql = "Select * from library where BorrowerID < 1";

    // get the meta data from the ResultSet
    ResultSet rs = st.executeQuery(sql);

    ResultSetMetaData rsmd = rs.getMetaData();
    for (int x= 1 ; x <= rsmd.getColumnCount(); x++)
    {
    headings.addElement(rsmd.getColumnName(x));
    }
    rs.close();
    st.close();
    this.closeConnection();
    }
    catch (Exception ex)
    {
    System.out.println(ex.getMessage());
    }
    return headings;
    }
    public Vector getBookLoansData()
    {
    Vector BookLoansData = new Vector();
    this.setConnection();
    try
    {
    Statement st = conn.createStatement();
    String sql = "Select * from library"; // get all the records
    ResultSet rs = st.executeQuery(sql);
    ResultSetMetaData rsmd = rs.getMetaData();
    while (rs.next()) // loop through all the records
    {
    Vector myrow = new Vector(); // create a vector for each row
    // Note: indexed from 1 to N not 0 to N-1
    for (int x= 1 ; x <= rsmd.getColumnCount(); x++)
    {
    myrow.addElement(rs.getString(x));
    }
    // add vector to overall vector
    BookLoansData.addElement(myrow);
    }
    rs.close();
    st.close();
    this.closeConnection();
    }
    catch(Exception ex)
    {
    System.out.println(ex.getMessage());
    }
    return BookLoansData;
    }
    }

    The errors i get are as follows:

    cannot resolve symbol
    symbol : class DataBase
    location: class dbase.Register
    public class Register extends DataBase
    ^
    cannot resolve symbol
    symbol : method setConnection ()
    location: class dbase.Register
    this.setConnection();
    ^
    cannot resolve symbol
    symbol : variable conn
    location: class dbase.Register
    Statement st = conn.createStatement();
    ^
    cannot resolve symbol
    symbol : method closeConnection ()
    location: class dbase.Register
    this.closeConnection();
    ^
    cannot resolve symbol
    symbol : method setConnection ()
    location: class dbase.Register
    this.setConnection();
    ^
    cannot resolve symbol
    symbol : variable conn
    location: class dbase.Register
    Statement st = conn.createStatement();
    ^
    cannot resolve symbol
    symbol : method closeConnection ()
    location: class dbase.Register
    this.closeConnection();
    ^
    Has this got something to do with packages, or is it something really
    obvious?
     
    Jody, Nov 15, 2004
    #1
    1. Advertising

  2. On Mon, 15 Nov 2004 15:33:07 -0000, Jody wrote:

    > Hey, i'm having issues with the following code:

    ....
    > public class Register extends DataBase


    For anyone who's news reader shows this as a new thread, you
    can read the former posts here....
    <http://groups.google.com/groups?threadm=4193a014$0$19637$>

    To the OP. Posting using the esact same (vague) title
    causes some newsreader clients to put the new post under the
    old one, while others will not. Instead, please 'Reply To'
    earlier posts and do not chage the subject line from what
    Outlook Express sets it to.

    Now.. why are you reposting the code and question,
    rather than continue from the response you got?

    > Has this got something to do with packages, or is it something really
    > obvious?


    Some other things I should have mentioned at the time are.

    Please do not post code that is not indented. Indenting with tabs
    is bad. Instead, replace tabs with 2 or 3 spaces before posting.

    Your questions are more appropriate to a beginners
    group described here.
    <http://www.physci.org/codes/javafaq.jsp#cljh>

    HTH

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Nov 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. @lex-kid
    Replies:
    2
    Views:
    2,394
    @lex-kid
    Jul 7, 2003
  2. sufia
    Replies:
    1
    Views:
    3,039
    @lex-kid
    Jul 6, 2003
  3. Jo

    Cannot resolve symbol

    Jo, Apr 9, 2004, in forum: Java
    Replies:
    3
    Views:
    2,724
    Roedy Green
    Apr 10, 2004
  4. Jody
    Replies:
    1
    Views:
    678
    Andrew Thompson
    Nov 11, 2004
  5. Replies:
    1
    Views:
    10,168
Loading...

Share This Page