cannot resolve symbol errors

J

Jody

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?
 
A

Andrew Thompson

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/[email protected]>

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top