?
Solved

Trouble with Javabean and separate class.

Posted on 2003-03-18
2
Medium Priority
?
249 Views
Last Modified: 2013-11-23
I have two .java files.
DataSet and joData both in a directory/package called databeans in Tomcat in the classes directory of my webapp.
When I javac DataSet, no problem.
But when I try to javac joData it gets the following error:

joData.java:5: cannot resolve symbol
symbol  : class DataSet
location: package databeans
import databeans.DataSet;
                 ^
joData.java:21: cannot resolve symbol
symbol  : class DataSet
location: class databeans.joData
                DataSet returnrecs = new DataSet();
                ^
joData.java:21: cannot resolve symbol
symbol  : class DataSet
location: class databeans.joData
                DataSet returnrecs = new DataSet();
                                         ^
Here are the two .java files

DataSet.java:

package databeans;
import java.util.*;
import java.sql.*;
public class DataSet
{
     public String Fname;
     public String Lname;
     public String CID;
     public String Phone;
     public String Email;
     public String CoID;
     public String CName;
}

joData.java:

package databeans;

import java.util.*;
import java.sql.*;
import databeans.DataSet;

public class joData
{


public Vector getData() throws Exception

{
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       Connection con = DriverManager.getConnection("jdbc:odbc:Remedy","sa","bubba");
       Statement stmt = con.createStatement();
       Vector records = new Vector();
       ResultSet rs = stmt.executeQuery("SELECT Contact_ID, First_Name, Last_Name, Phone__, Email_Address, Company_ID, Company_Name   FROM base_Contact WHERE (Contact_Status = 0) AND (Company_Name <> 'Apropos') AND (Last_Name <> 'Test') ORDER BY Company_Name, Last_Name");
       while (rs.next())
       {
          DataSet returnrecs = new DataSet();
          returnrecs.CID = rs.getString("Contact_ID");
          returnrecs.Fname = rs.getString("First_Name");
          returnrecs.Lname = rs.getString("Last_Name");
          returnrecs.Phone = rs.getString("Phone__");
          returnrecs.Email = rs.getString("Email_Address");
          returnrecs.CoID = rs.getString("Company_ID");
          returnrecs.CName = rs.getString("Company_Name");
          records.addElement(returnrecs);
     }
    con.close();
     return records;
}

}

Could someone help me figure out why I get that error when trying to compile joData?

thanks,

Ed
0
Comment
Question by:eteune
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 80 total points
ID: 8162486
import databeans.DataSet;

is DataSet also in package databeans? if so, you don't need the above line.
what IDE are you using?

try doing javac -classpath . joData.java
(so that it includes the class files in the current directory)



0
 

Author Comment

by:eteune
ID: 8162603
That did it, I needed to include the classpath, thanks,
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question