Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > cannot resolve symbol errors

Reply
Thread Tools

cannot resolve symbol errors

 
 
Jody
Guest
Posts: n/a
 
      11-15-2004
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?



 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-15-2004
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$ .pipex.com>

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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
src-resolve: Cannot resolve the name ... ivanet@gmail.com XML 1 03-23-2007 12:10 PM
cannot resolve symbol errors Jody Java 1 11-11-2004 05:46 PM
Cannot resolve symbol Jo Java 3 04-10-2004 06:12 PM
Re: Cannot resolve Symbol (class) but why? (JSP) @lex-kid Java 2 07-07-2003 07:26 AM
Re: Cannot resolve Symbol (class) but why? (JSP) sufia Java 1 07-06-2003 07:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57