JSP vs .class problem

Hi guys , another jsp question....
Im currently using methods in these classes

package video;
import java.util.*;
import java.sql.*;
import javax.swing.JOptionPane;
import java.io.*;


public class Customer
{
      private String id="CST00001";
      private String firstName="maj";
      private String lastName="yaghmour";
      private String address = "koolo";
      private String areaCode = "02";
      private String telephoneNo ="0415700203";
      private String email = "hotmail.com";
      private char gender='m';
      private String password = "eee";
      private boolean eligibilityStatus = false;
      private int idType = 0;
      private String idNumber ="9914555";
      private boolean outstandingFines = false;
      private double finesToDate = 0.0;


      public Customer()
      {
      }
      public Customer(String id, String fn, String ln, String add, String ac, String tel,
                              String em, char sex, String pw, boolean es, int idt,
                              String idn,boolean fine, double fineTotal){
            this.id=id;
            firstName = fn;
            lastName = ln;
            address = add;
            areaCode = ac;
            telephoneNo = tel;
            email = em;
            gender = sex;
            password = pw;
            eligibilityStatus = es;
            idType = idt;
            idNumber = idn;
            outstandingFines = fine;
            finesToDate = fineTotal;
      }
      public Customer(String id, String fn, String ln)
            {
                  this.id=id;
                  firstName = fn;
                  lastName = ln;
            }
      
            public String getId()
            {
                  return id;
            }
            public void setId(String id)
            {
                  this.id = id;
            }
      
            public String getFirstName()
            {
                  return firstName;
            }
            public void setFirstName(String fn)
            {
      
                  firstName = fn;
            }
      
            public String getLastName()
            {
                  return lastName;
            }
            public void setLastName(String ln)
            {
                  lastName = ln;
            }
      
            public String getAddress()
            {
                  return address;
            }
            public void setAddress(String add)
            {
                  address = add;
            }
      
            public String getAreaCode()
            {
                  return areaCode;
            }
            public void setAreaCode(String ac)
            {
                  areaCode = ac;
            }
      
            public String getTelephoneNo()
            {
                  return telephoneNo;
            }
            public void setTelephoneNo(String tn)
            {
                  telephoneNo = tn;
            }
      
            public String getEmail()
            {
                  return email;
            }
            public void setEmail(String em)
            {
                  email = em;
            }
      
            public char getGender()
            {
                  return gender;
            }
            public void setGender(char sex)
            {
                  gender = sex;
            }
            public String getPassword()
            {
                  return password;
            }
            public void setPassword(String pw)
            {
                  password = pw;
            }
            public boolean getEligibilityStatus()
            {
                  return eligibilityStatus;
            }
            public void setEligibilityStatus(boolean es)
            {
                  eligibilityStatus = es;
            }
            public int getIdType()
            {
                  return idType;
            }
            public void setIdType(int idt)
            {
                  idType = idt;
            }
      
            public String getIdNumber()
            {
                  return idNumber;
      
            }
            public void setIdNumber(String idn)
            {
                  idNumber = idn;
            }
      
            public boolean getOutstandingFines()
            {
                  return outstandingFines;
            }
            public void setOutstandingFines(boolean fine)
            {
                  outstandingFines = fine;
            }
      
            public double getFinesToDate()
            {
                  return finesToDate;
            }
            public void setFinesToDate( double ftd )
            {
                  finesToDate = ftd;
            }
            public void processFine( double fine )
            {
                  finesToDate += fine;
                  if( finesToDate > 0 )
                        outstandingFines = true;
      }
      
***************************************************************************************


//Class that creates manages all communication with database
//loads driver
//create the connection and Statement
//which are used to execute the various Updates and queries
//package video;
import java.sql.*;


public class Ass2Data
{
      public static Connection con;
      public static Statement stmt;
      public static ResultSet  results;

public Ass2Data()
{
}

public static void connectToDatabase()//works ok
      {

//For Access database
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url   = "*****************************";
String username = "";
String password = "";


try {
System.out.println("DataBase connected");
            //Loads and register required Driver
            Class.forName (driver);
            // Attempt to create connection to database.
            con = DriverManager.getConnection(url, username, password);
            //creates statement to send queries and return results
            stmt = con.createStatement ();
      } catch (SQLException ex)
      {
            while (ex != null)
            {
                  System.out.println ("SQL Exception:  " + ex.getMessage ());
                  ex = ex.getNextException ();
            }
      } catch (java.lang.Exception ex)
      {
            ex.printStackTrace ();
      }
}


}

************************************************************
my simple jsp file is as follows

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%-- page settings via directives--%>
<%@ page import = "java.util.*" %>
<%@ page import = "video.*" %>

<%-- Customer bean used to get all item data --%>
<jsp:useBean id = "customer" scope = "page"  class = "video.Customer" />

   <head>
      <title>Login Page</title>
   </head>

   <body >
   <% if(request.getParameter("Login")!=null)
   {
 System.out.println("***** " + customer.getId());
           //    customer.getRecFromDatabase(request.getParameter("CusID"));
       //   if( request.getParameter("CusID") == customer.getIdNumber() )
       //   if( request.getParameter("pass") == customer.getPassword() )
         {
         //                response.sendRedirect("/customer.jsp");
                   
         }

     }
     else
     {
   %>
      <h2 align=center>Account Login</h2>
      <form action=password.jsp method=get>
      <table width=60% align=center bgcolor=#E0E0E0 border=1>
            <tr>
               <th colspan =2>Enter Customer Password</th>
            </tr>
            <tr>
                <td>CustomerID</td><td><input type=text name=CusID size=35></td>
            </tr>
            <tr>
                  <td>Password</td><td><input type=password name=pass size=35></td>
            </tr>
         
 
   
            <input type =hidden name=Login value=yes>
            <tr>
            <td colspan= 2 align=center><input type=Submit value=login>&nbsp;&nbsp;&nbsp;<input type=reset value=Exit></td>
            </tr>            
      </table>
      </form>
      <p>&nbsp</p>
      <p><center><a href=CustomerDetails.jsp>Return to catalog</a>
   <% }  %>
   
   
   </body>

</html>


______________________________________________________________
The problem im facing is when ever i try to access the  Ass2Data.connectToDatabase(); method by calling customer.getRecFromDatabase(request.getParameter("CusID")); as u can see in the password.jsp file i get this error :

**********************************
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 14 in the jsp file: /password.jsp

Generated servlet error:
    [javac] Compiling 1 source file

C:\Tomcat 4.1\work\Standalone\localhost\_\password_jsp.java:71: cannot resolve symbol
symbol  : method getRecFromDatabase  (java.lang.String)
location: class video.Customer
        customer.getRecFromDatabase(request.getParameter("CusID"));
                ^
1 error


      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:248)
      at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:315)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:328)
********************************************************

when i add the package video; at the top of the Ass2Data it give this error
*****************************************************
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:195: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              Ass2Data.connectToDatabase();
                  ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:197: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              ResultSet rs = Ass2Data.getSingleCustomer( s1  );
                                 ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:237: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:239: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
       Ass2Data.closeDatabase();
        ^
4 errors
****************************************************
note that the 2 jave files only compiled with no errors when the line package video; was not added in both classes .
Dj_majAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nick_72Commented:
Hi,

the first thing you should include is the getRecFromDatabase() method in the Customer class.
You're trying to call such a method but it doesn't exist.

/Nick
Dj_majAuthor Commented:
sorry the method exists in the Customer class but i forgot to post it here

package video;
import java.util.*;
import java.sql.*;
import javax.swing.JOptionPane;
import java.io.*;


public class Customer
{
     private String id="CST00001";
     private String firstName="maj";
     private String lastName="yaghmour";
     private String address = "koolo";
     private String areaCode = "02";
     private String telephoneNo ="0415700203";
     private String email = "hotmail.com";
     private char gender='m';
     private String password = "eee";
     private boolean eligibilityStatus = false;
     private int idType = 0;
     private String idNumber ="9914555";
     private boolean outstandingFines = false;
     private double finesToDate = 0.0;


     public Customer()
     {
     }
     public Customer(String id, String fn, String ln, String add, String ac, String tel,
                         String em, char sex, String pw, boolean es, int idt,
                         String idn,boolean fine, double fineTotal){
          this.id=id;
          firstName = fn;
          lastName = ln;
          address = add;
          areaCode = ac;
          telephoneNo = tel;
          email = em;
          gender = sex;
          password = pw;
          eligibilityStatus = es;
          idType = idt;
          idNumber = idn;
          outstandingFines = fine;
          finesToDate = fineTotal;
     }
     public Customer(String id, String fn, String ln)
          {
               this.id=id;
               firstName = fn;
               lastName = ln;
          }
     
          public String getId()
          {
               return id;
          }
          public void setId(String id)
          {
               this.id = id;
          }
     
          public String getFirstName()
          {
               return firstName;
          }
          public void setFirstName(String fn)
          {
     
               firstName = fn;
          }
     
          public String getLastName()
          {
               return lastName;
          }
          public void setLastName(String ln)
          {
               lastName = ln;
          }
     
          public String getAddress()
          {
               return address;
          }
          public void setAddress(String add)
          {
               address = add;
          }
     
          public String getAreaCode()
          {
               return areaCode;
          }
          public void setAreaCode(String ac)
          {
               areaCode = ac;
          }
     
          public String getTelephoneNo()
          {
               return telephoneNo;
          }
          public void setTelephoneNo(String tn)
          {
               telephoneNo = tn;
          }
     
          public String getEmail()
          {
               return email;
          }
          public void setEmail(String em)
          {
               email = em;
          }
     
          public char getGender()
          {
               return gender;
          }
          public void setGender(char sex)
          {
               gender = sex;
          }
          public String getPassword()
          {
               return password;
          }
          public void setPassword(String pw)
          {
               password = pw;
          }
          public boolean getEligibilityStatus()
          {
               return eligibilityStatus;
          }
          public void setEligibilityStatus(boolean es)
          {
               eligibilityStatus = es;
          }
          public int getIdType()
          {
               return idType;
          }
          public void setIdType(int idt)
          {
               idType = idt;
          }
     
          public String getIdNumber()
          {
               return idNumber;
     
          }
          public void setIdNumber(String idn)
          {
               idNumber = idn;
          }
     
          public boolean getOutstandingFines()
          {
               return outstandingFines;
          }
          public void setOutstandingFines(boolean fine)
          {
               outstandingFines = fine;
          }
     
          public double getFinesToDate()
          {
               return finesToDate;
          }
          public void setFinesToDate( double ftd )
          {
               finesToDate = ftd;
          }
          public void processFine( double fine )
          {
               finesToDate += fine;
               if( finesToDate > 0 )
                    outstandingFines = true;
     }
     

// Get a record from database
      public boolean getRecFromDatabase( String s1 )
      {
       System.out.println("Starts here");
       boolean successful = false;
       try
       {
              System.out.println("try here");
              Ass2Data.connectToDatabase();
              System.out.println("Connects here for customer");
              ResultSet rs = Ass2Data.getSingleCustomer( s1  );
              System.out.println("ResultSet here");
            // if the return result not empty, assign values to the data members
           if( rs.next() )
            {
                  System.out.println("here we go");
                  this.id = rs.getString               ( 1 );
                   firstName = rs.getString             ( 2 );
                  lastName = rs.getString              ( 3 );
                  address = rs.getString               ( 4 );
                  areaCode = rs.getString              ( 5 );
                  telephoneNo = rs.getString             ( 6 );
                  email = rs.getString                  ( 7 );
                  gender = rs.getString            ( 8 ).charAt( 0 );
                     password = rs.getString          ( 9 );
                    eligibilityStatus = new Boolean( rs.getString( 10 ) ).booleanValue();
                 idType = rs.getInt               ( 11 );
                    idNumber = rs.getString          ( 12 );
                     outstandingFines =  new Boolean( rs.getString( 13 ) ).booleanValue();
                    finesToDate = rs.getDouble       ( 14 );
                   successful = true;

        }
             return successful;


       }
      catch (SQLException ex)
      {
            while (ex != null)
            {
                   System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                   System.out.println ("SQL Exception:  " + ex.getMessage ());
                   ex = ex.getNextException ();
            }
      }
      catch (java.lang.Exception ex)
      {
          ex.printStackTrace ();
            System.out.println("EXCEPTION####################!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            Ass2Data.closeDatabase();
      }
       Ass2Data.closeDatabase();
      return(successful);

      }/*************************************************************/
}
Nick_72Commented:
It looks ok. The compiler complains about not finding the method, so if the Customer class is compiled with that method it should find it.
Try to recompile Customer class and replace the old class file in the classes/video folder. The second error about adding the package name to the Ass2Data file might be caused by that you haven't moved that class file to the classes/video folder.

/Nick
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Dj_majAuthor Commented:
hi mate,
I am compiling the classes at the same location of video , but now i came to conclusion that the error is occuring from the 2 classes only so plz forget about the jsp file for now , and tell me why when i compile the 2 files before adding the line package video ; in each of them or in the customer.java i get No compilation error , but when i do add that line which i believe is important i get this error , can u explain this ?

C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:240: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
        Ass2Data.connectToDatabase();
        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:241: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
          if( Ass2Data.AddNewCustomer(
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:258: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
                   Ass2Data.closeDatabase();
                        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:263: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
                  Ass2Data.closeDatabase();
                        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:269: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.connectToDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:270: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            if( Ass2Data.ChangePass( getPassword(), getId() ))
                    ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:274: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:279: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
      Ass2Data.connectToDatabase();
        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:280: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
      if(Ass2Data.updateCustomer(
           ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:298: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:303: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.connectToDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:306: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              if( Ass2Data.deleteCustomer( getId() ))
                      ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:310: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
          Ass2Data.closeDatabase();
        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:321: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              Ass2Data.connectToDatabase();
                  ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:323: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              ResultSet rs = Ass2Data.getSingleCustomer( s1  );
                                 ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:363: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:365: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
       Ass2Data.closeDatabase();
        ^

Tool completed with exit code 1
 
Nick_72Commented:
If you inlclude the line

package video;

the file (.java) must be in a folder named video. If it is not, then it can't find it.
The folder(s) the files reside in is a mirror of the package name.

For example, if the package name is

package com.dj.maj.video;

the folder structure must look like com/dj/maj/video and in the video folder the java files are located.
So if the package is video, make sure the java files are located in a folder named video.
If just one of them have that package name and the other has none, the second should be located in the level just above the video folder.
As you mention both of them should have a package name though.

/Nick
Dj_majAuthor Commented:
both classes are in folder video
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video
and these are the complete classes again:-
mabe this will give a better idea about what's happening

package video;
import java.util.*;
import java.sql.*;
import javax.swing.JOptionPane;


public class Customer
{
      private String id="CST00001";
      private String firstName="maj";
      private String lastName="yaghmour";
      private String address = "koolo";
      private String areaCode = "02";
      private String telephoneNo ="0415700203";
      private String email = "hotmail.com";
      private char gender='m';
      private String password = "eee";
      private boolean eligibilityStatus = false;
      private int idType = 0;
      private String idNumber ="9914555";
      private boolean outstandingFines = false;
      private double finesToDate = 0.0;
      //Ass2Data data

      public Customer()
      {

      }
      public Customer(String id, String fn, String ln, String add, String ac, String tel,
                              String em, char sex, String pw, boolean es, int idt,
                              String idn,boolean fine, double fineTotal){
            this.id=id;
            firstName = fn;
            lastName = ln;
            address = add;
            areaCode = ac;
            telephoneNo = tel;
            email = em;
            gender = sex;
            password = pw;
            eligibilityStatus = es;
            idType = idt;
            idNumber = idn;
            outstandingFines = fine;
            finesToDate = fineTotal;
      }

      //temp constructor
      public Customer(String id, String fn, String ln)
      {
            this.id=id;
            firstName = fn;
            lastName = ln;
      }

      public String getId()
      {
            return id;
      }
      public void setId(String id)
      {
            this.id = id;
      }

      public String getFirstName()
      {
            return firstName;
      }
      public void setFirstName(String fn)
      {

            firstName = fn;
      }

      public String getLastName()
      {
            return lastName;
      }
      public void setLastName(String ln)
      {
            lastName = ln;
      }

      public String getAddress()
      {
            return address;
      }
      public void setAddress(String add)
      {
            address = add;
      }

      public String getAreaCode()
      {
            return areaCode;
      }
      public void setAreaCode(String ac)
      {
            areaCode = ac;
      }

      public String getTelephoneNo()
      {
            return telephoneNo;
      }
      public void setTelephoneNo(String tn)
      {
            telephoneNo = tn;
      }

      public String getEmail()
      {
            return email;
      }
      public void setEmail(String em)
      {
            email = em;
      }

      public char getGender()
      {
            return gender;
      }
      public void setGender(char sex)
      {
            gender = sex;
      }
      public String getPassword()
      {
            return password;
      }
      public void setPassword(String pw)
      {
            password = pw;
      }
      public boolean getEligibilityStatus()
      {
            return eligibilityStatus;
      }
      public void setEligibilityStatus(boolean es)
      {
            eligibilityStatus = es;
      }
      public int getIdType()
      {
            return idType;
      }
      public void setIdType(int idt)
      {
            idType = idt;
      }

      public String getIdNumber()
      {
            return idNumber;

      }
      public void setIdNumber(String idn)
      {
            idNumber = idn;
      }

      public boolean getOutstandingFines()
      {
            return outstandingFines;
      }
      public void setOutstandingFines(boolean fine)
      {
            outstandingFines = fine;
      }

      public double getFinesToDate()
      {
            return finesToDate;
      }
      public void setFinesToDate( double ftd )
      {
            finesToDate = ftd;
      }
      public void processFine( double fine )
      {
            finesToDate += fine;
            if( finesToDate > 0 )
                  outstandingFines = true;
      }
      public void processFinePayment( double fine )
      {
            boolean done = false;
            while( !done )
            {
                  if( ( finesToDate - fine ) < 0 )
                  {
                        JOptionPane.showMessageDialog(null, "PLease Pay the exact amount of $" + getFinesToDate() + "!!!");
                        done = true;
                        break;
                  }
                        else
                        {
                              finesToDate -= fine;
                              if( finesToDate > 0 )
                              {
                                    outstandingFines = true;

                              }
                              done = true;
                              break;
                        }
            }

      }
      public String convertToString( boolean b )
      {
            if ( b )
                  return( "true" );
            else
                  return( "false" );
      }

      public boolean isUpdatable()
      {
            boolean canUpdate = true;
            if( finesToDate > 0 )
                  canUpdate = false;
            if( isRenting() )
                  canUpdate = false;
            return canUpdate;
      }

      public boolean isRenting()
      {
            //checks database to see if has any rentals out;
            return false;
      }

      // Add a record to database
      public void addToDatabase()
      {
      //      JOptionPane.showMessageDialog(null, toString1(), "add to db", JOptionPane.INFORMATION_MESSAGE);

        Ass2Data.connectToDatabase();
          if( Ass2Data.AddNewCustomer(
                   getNewID(),
                        getFirstName(),
                              getLastName(),
                                    getAddress(),
                                          getAreaCode(),
                                                getTelephoneNo(),
                                                      getEmail(),
                                                            String.valueOf( getGender() ),
                                                      getPassword(),
                                                String.valueOf( getEligibilityStatus() ),
                                          getIdType(),
                                    getIdNumber(),
                              String.valueOf( getOutstandingFines() ),
                  getFinesToDate() ))
            {
                   JOptionPane.showMessageDialog(null, toString1(), "done", JOptionPane.INFORMATION_MESSAGE);
                   Ass2Data.closeDatabase();
            }
            else
            {
                  JOptionPane.showMessageDialog(null, "Prob on insert");
                  Ass2Data.closeDatabase();
            }

      }
      public void updateDatabasePass()
      {
            Ass2Data.connectToDatabase();
            if( Ass2Data.ChangePass( getPassword(), getId() ))
            {
                  JOptionPane.showMessageDialog(null, toString1(), "PassWord updated to db", JOptionPane.INFORMATION_MESSAGE);
            }
            Ass2Data.closeDatabase();
      }
      // Update a record in database
      public void updateDatabase()
      {
      Ass2Data.connectToDatabase();
      if(Ass2Data.updateCustomer(
                  getId(),
                        getFirstName(),
                              getLastName(),
                                    getAddress(),
                                          getAreaCode(),
                                                getTelephoneNo(),
                                                      getEmail(),
                                                String.valueOf( getGender() ),
                                          getPassword(),
                                    String.valueOf( getEligibilityStatus() ),
                              getIdType(),
                        getIdNumber(),
                  String.valueOf( getOutstandingFines() ),
            getFinesToDate() ))
            {
      //            JOptionPane.showMessageDialog(null, toString1(), "update to db", JOptionPane.INFORMATION_MESSAGE);
            }
            Ass2Data.closeDatabase();
      }
      // Delete a record from database
      public void deleteFromDatabase()
      {
            Ass2Data.connectToDatabase();
       //      String Str = JOptionPane.showInputDialog(null, "Enter cus number", "Payment for " ,JOptionPane.INFORMATION_MESSAGE);

              if( Ass2Data.deleteCustomer( getId() ))
            {
                   JOptionPane.showMessageDialog( null, toString1(), "Customer deleted from db", JOptionPane.INFORMATION_MESSAGE);
            }
          Ass2Data.closeDatabase();
      }

      // Get a record from database
      public boolean getRecFromDatabase( String s1 )
      {
       System.out.println("Starts here");
       boolean successful = false;
       try
       {
              System.out.println("try here");
              Ass2Data.connectToDatabase();
              System.out.println("Connects here for customer");
              ResultSet rs = Ass2Data.getSingleCustomer( s1  );
              System.out.println("ResultSet here");
            // if the return result not empty, assign values to the data members
           if( rs.next() )
            {
                  System.out.println("here we go");
                  this.id = rs.getString               ( 1 );
                   firstName = rs.getString             ( 2 );
                  lastName = rs.getString              ( 3 );
                  address = rs.getString               ( 4 );
                  areaCode = rs.getString              ( 5 );
                  telephoneNo = rs.getString             ( 6 );
                  email = rs.getString                  ( 7 );
                  gender = rs.getString            ( 8 ).charAt( 0 );
                     password = rs.getString          ( 9 );
                    eligibilityStatus = new Boolean( rs.getString( 10 ) ).booleanValue();
                 idType = rs.getInt               ( 11 );
                    idNumber = rs.getString          ( 12 );
                     outstandingFines =  new Boolean( rs.getString( 13 ) ).booleanValue();
                    finesToDate = rs.getDouble       ( 14 );
                   successful = true;

        }
             return successful;


       }
      catch (SQLException ex)
      {
            while (ex != null)
            {
                   System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                   System.out.println ("SQL Exception:  " + ex.getMessage ());
                   ex = ex.getNextException ();
            }
      }
      catch (java.lang.Exception ex)
      {
          ex.printStackTrace ();
            System.out.println("EXCEPTION####################!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            Ass2Data.closeDatabase();
      }
       Ass2Data.closeDatabase();
      return(successful);

      }/*************************************************************/
      public String toString1()
      {
            return("ID:         " + id + "\n" +
                     "First name: " + firstName + "\n" +
                     "Last name:  " + lastName + "\n" +
                     "Address:    " + address + "\n" +
                     "Area Code:  " + areaCode + "\n" +
                     "Telephone:  " + telephoneNo+ "\n" +
                     "Email:      " + email + "\n" +
                     "gender:     " + gender + "\n" +
                     "password:   " + password + "\n" +
                     "eligible status: " + eligibilityStatus + "\n" +
                     "id type:         " + idType + "\n" +
                     "idNo:            " + idNumber + "\n" +
                     "fines?:          " + outstandingFines + "\n" +
                     "fine total:      " + finesToDate);
      }

      public String toString()
      {
            return(id + "-" + firstName + " " + lastName);
      }

      public boolean equals(Object o)
      {
            boolean same = false;
            if(o instanceof Customer)
            {
                  if(id.equals(((Customer)o).getId()))
                        same=true;
            }else{
                  same = false;
            }

            return same;
      }
      public static void main (String args[])
      {
      }

}


********************************************************************************************************************************************************************************

//Class that creates manages all communication with database
//loads driver
//create the connection and Statement
//which are used to execute the various Updates and queries
package video;
import java.sql.*;


public class Ass2Data
{
      public static Connection con;
      public static Statement stmt;
      public static ResultSet  results;

//**********METHODS TO ADD NEW UPDATE AND DELETE A CUSTOMER***************//

      public static boolean AddNewCustomer( String id ,String fName,
      String lName,String Add,String Code,String tele,String email,
      String genre,String pw,String el,int type,String num,String out,
      double fi )//works ok
      {
            boolean done = false;
            try{

                  String sql  = "INSERT INTO customer VALUES ('" +
                                                             id    + "','"    +
                                                             fName + "','"    +
                                                             lName + "','"    +
                                                             Add   + "','"    +
                                                             Code  + "','"    +
                                                             tele  + "','"    +
                                                             email + "','"    +
                                                             genre + "','"    +
                                                             pw    + "','"    +
                                                        el    + "','"    +
                                                             type  + "','"    +
                                                          num   + "','"    +
                                                            out   + "','"    +
                                                             fi    + "')";


                   int rc = stmt.executeUpdate(sql);
                   System.out.println("done");
                  return true;
            }
            catch(SQLException e)
            {
                  while(e!=null)
                  {
                        System.out.println("INSERT ERROR " + e.getMessage());
                        e = e.getNextException();
                  }
            }
            return done;
      }/**********************************************************/
      public static boolean updateCustomer(String id, String fName,
      String lName,String Add,String Code,String tele,String email,
      String genre,String pw,String el,int type,String num,String out,
      double fi)//works ok
      {
            boolean ok = false;
      try{
                         String sql = "UPDATE customer SET " +
                                                            " firstName ='"                   + fName + "'," +
                                                            " lastName ='"                    + lName + "'," +
                                                            " address ='"                + Add   + "'," +
                                                            " areaCode ='"               + Code  + "'," +
                                                            " telephoneNo ='"             + tele  + "'," +
                                                            " email ='"                   + email + "'," +
                                                            " gender ='"                  + genre + "'," +
                                                            " password ='"                + pw    + "'," +
                                                            " eligibilityStatus ='"  + el    + "'," +
                                                            " idType ='"             + type  + "'," +
                                                            " idNumber ='"           + num   + "'," +
                                                            " outstandingFines ='"   + out   + "'," +
                                                            " fineToDate ='"         + fi        + "' " +
                                                            " WHERE customerID = '"  + id    + "'";



            //      System.out.println(sql);
                  System.out.println("Customer id record " + id + " has been updated");
                  int rc = stmt.executeUpdate(sql);
                  return true;
            }catch(SQLException e){
                  while(e!=null)
                  {
                        System.out.println("Customer UPDATE ERROR " + e.getMessage());
                        e = e.getNextException();
                  }
            }
            return ok;
      }
      /*********************************************************/
      public static boolean deleteCustomer(String id)//works ok
      {
            boolean ok = false;
            try{
                  String sql = "DELETE FROM customer  " +
                        "WHERE customerID = '" + id  + "'";

                  int rc = stmt.executeUpdate(sql );
                  return true;
            }catch(SQLException e){
                  while(e!=null){
                        System.out.println("DELETION ERROR " + e.getMessage());
                        e = e.getNextException();
                  }
            }
            return ok;
      }/**************************************************/
      public static boolean ChangePass(String pw,String id)
      {
            boolean ok = false;
            try{
                  String sql = "UPDATE customer Set "  +
                                          " password ='" + pw  + "' " +
                                          " WHERE customerID = '" + id + "'";


                  int rc = stmt.executeUpdate(sql);
                  return true;
            }catch(SQLException e){
                  while(e!=null){
                        System.out.println("PassWord Update ERROR " + e.getMessage());
                        e = e.getNextException();
                  }
            }
            return ok;
      }
      /*******************************************************************/
      public static boolean UpdateItemStat(String stat,String rDate,String Id)
      {//works ok
                  boolean ok = false;
                  try{
                        String sql = "UPDATE item Set " +
                                                " currentStatus ='"  + stat  + "'," +
                                                " returnedDate = '"  + rDate + "' " +
                                                " WHERE itemID = '"  + Id    + "'";

                        int rc = stmt.executeUpdate(sql);
                        return true;
                  }catch(SQLException e){
                        while(e!=null){
                              System.out.println("UpdateItemStat ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return ok;
 }
 //**********METHODS TO CREATE BOOK DATABASE TABLES***************//
    public static boolean UpdateReturn(String date,String Id,String cId)
      {//works ok

            boolean ok = false;
            try{
                  String sql  = "UPDATE renteditem Set " +
                                      " dateReturned ='" + date  + "' " +
                                      " WHERE itemID = '" + Id   + "' " +
                                      " AND customerID = '" +  cId   + "'";

                        int rc = stmt.executeUpdate(sql);
                        return true;
                  }catch(SQLException e){
                        while(e!=null){
                              System.out.println("Item return Update ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
      return ok;
      }
      /******************************************************************/
      public static ResultSet getSingleItem(String ID)
      {

                  try{
                        String sql = "SELECT * from item " +
                                    "WHERE itemID ='" + ID + "'";



                        results = stmt.executeQuery(sql);
                  }catch(Exception e){
                                    System.out.println("SQL ERROR: " + e.toString());
                              }
                              return results;
      }
      /******************************************************************/
      public static ResultSet getSingleCustomer(String ID)//works ok
      {//works ok

                        try{
                              String sql = "SELECT * FROM customer " +
                                          "WHERE customerID ='" + ID  + "'";


                                          //String sql2 = "SELECT * from customer " ;

                              results = stmt.executeQuery(sql);
                        }catch(Exception e){
                                          System.out.println("SQL ERROR: " + e.toString());
                                    }
                                    return results;
            }/*************************************************/
            public static ResultSet getCustomerHistory(String ID)
            {

                                    try{
                                          String sql = "SELECT i.* FROM item As i,rentedItem As ri WHERE i.itemID = ri.itemID AND customerID ='" + ID  + "'";


                                                      //String sql2 = "SELECT * from customer " ;

                                          results = stmt.executeQuery(sql);
                                    }catch(Exception e){
                                                      System.out.println("SQL ERROR: " + e.toString());
                                                }
                                                return results;
            }
/************************************************************************/
public static ResultSet getBooking(String book)//works ok
{//works ok

      try{
            String sql = "SELECT * FROM booking " +
                             "WHERE bookingID ='"  + book  + "'" ;


      System.out.println(sql);
            results = stmt.executeQuery(sql);
      }catch(Exception e){
                        System.out.println("SQL ERROR: " + e.toString());
                  }
                  return results;
}
/************************************************************************/
/************************************************************************/
      public static boolean AddNewItem( String id ,String title,
            String prod,String rate,String desc,int form,int gen,int per,
            double pri,String stat,String by,String date,String due,String re)
            {//works ok
                  boolean done = false;
                  try{
                          String sql  = "INSERT INTO item VALUES ('" +
                                                                   id    + "','"    +
                                                                   title + "','"    +
                                                                   prod  + "','"    +
                                                                   rate  + "','"    +
                                                                   desc  + "','"    +
                                                                   form  + "','"    +
                                                                   gen   + "','"    +
                                                                   per   + "','"    +
                                                                   pri   + "','"    +
                                                              stat  + "','"    +
                                                                   by    + "','"    +
                                                                date  + "','"    +
                                                                  due   + "','"    +
                                                                   re    + "')";


                         int rc = stmt.executeUpdate(sql);
                         System.out.println("done");
                        return true;
                  }
                  catch(SQLException e)
                  {
                        while(e!=null)
                        {
                              System.out.println("ITEM INSERT ERROR " +"Item Already Exist" + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return done;
      }

      /************************************************************************/
            public static boolean AddIntoBooking( String file ,String book,
                  String bookDate,String pickupDate,String pickupTime, String cusName,String cusNo )
                  {//works ok
                        boolean done = false;
                        try{
                                String sql  = "INSERT INTO orders VALUES ('"     +
                                                                         file      + "','"    +
                                                                         book      + "','"    +
                                                                         bookDate  + "','"    +
                                                                         pickupDate  + "','"    +
                                                                         pickupTime  + "','"    +
                                                                         cusName     + "','"    +
                                                                       cusNo       + "')";

                              System.out.println(sql);
                               int rc = stmt.executeUpdate(sql);
                               System.out.println("done");
                              return true;
                        }
                        catch(SQLException e)
                        {
                              while(e!=null)
                              {
                                    System.out.println("Write To Booking ERROR "  + e.getMessage());
                                    e = e.getNextException();
                              }
                        }
                        return done;
      }
      /**********************************************************************/
      public static boolean deleteItem(String id)//works ok
            {
                  boolean ok = false;
                  try{
                        String sql = "DELETE FROM item  " +
                        "WHERE itemID = '" + id + "'";

                        int rc = stmt.executeUpdate( sql );
                        return true;
                  }catch(SQLException e){
                        while(e!=null){
                              System.out.println("DELETION ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return ok;
      }/*************temp***************************/
      public static ResultSet SearchItem(int genre)
      {

                        try{
                               String sql = "SELECT * FROM item " +
                              "WHERE genre =" + genre;



                              results = stmt.executeQuery(sql);

                        }catch(Exception e){
                                          System.out.println("SQL ERROR: " + e.toString());
                                    }
                                    return results;
      }/**********************************************/
      public static ResultSet SearchItemAll(int genre)
      {

                              try{
                                     String sql = "SELECT * FROM item ";




                                    results = stmt.executeQuery(sql);

                              }catch(Exception e){
                                                System.out.println("SQL ERROR: " + e.toString());
                                          }
                                          return results;
      }/*
      public static ResultSet SearchItemAll2(int genre)
            {

                                    try{
                                           String sql = "SELECT * FROM item ";




                                          results = stmt.executeQuery(sql);

                                    }catch(Exception e){
                                                      System.out.println("SQL ERROR: " + e.toString());
                                                }
                                                return results;
      }*/
      /********************************************/
      public static ResultSet SearchByType(int Type)
      {

                              try{
                                     String sql = "SELECT * FROM item " +
                                    "WHERE genre =" + Type;



                                    results = stmt.executeQuery(sql);

                              }catch(Exception e){
                                                System.out.println("SQL ERROR: " + e.toString());
                                          }
                                          return results;
      }
      /**********************************************************************/
      public static boolean updateItem(//works ok
            String id,
            String ti,
            String pro,
            String rate,
            String desc,
            int form,
            int gener,
            int per,
            double price,
            String stat,
            String by,
            String date,
            String due,
            String re )
            {
                  boolean ok = false;
            try{
                         String sql = "UPDATE item SET " +
                                                " title ='"                   + ti    + "'," +
                                                " producer ='"              + pro   + "'," +
                                                " rating ='"                + rate  + "'," +
                                                " description ='"         + desc  + "'," +
                                                " format ='"             + form  + "'," +
                                                " genre ='"             + gener + "'," +
                                                " rentPeriod ='"     + per   + "'," +
                                                " rentalPrice ='"    + price + "'," +
                                                " currentStatus ='"  + stat  + "'," +
                                                " rentedBy ='"       + by    + "'," +
                                                " rentDate ='"       + date  + "'," +
                                                " dueDate ='"        + due   + "'," +
                                                " returnedDate ='"   + re        + "' " +
                                                " WHERE itemID = '"  + id    + "'";




                        int rc = stmt.executeUpdate(sql);
                        return true;
                  }catch(SQLException e){
                        while(e!=null)
                        {
                              System.out.println("Item UPDATE ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return ok;
      }/**********************************************************************/
      public static boolean AddRentedItem(String ItemId, String CusId,
      String rentDate,String dueDate,String retur)//works ok
      {
            boolean done = false;
            try{
                  String sql = "INSERT INTO renteditem VALUES ('"
                  + ItemId +   "','"
                   + CusId +    "','"
                  + rentDate + "','"
                  + dueDate +  "','"
                  + retur +  "')";

                  int rc = stmt.executeUpdate( sql );
                  return true;
            }catch(SQLException e)
            {
                  while(e!=null)
                  {
                        System.out.println("RentedItem  ERROR " + e.getMessage());
                        e = e.getNextException();
                  }
            }
            return done;

      }
      public static boolean UpdateItemRentedBy( String by,String id , String current ,String RentDate, String DueDate )
      {//works ok

      boolean ok = false;
      try{
            String sql  = "UPDATE item Set " +
                                " rentedBy ='"       + by       + "'," +
                                " currentStatus = '" + current  + "'," +
                                " rentDate = '"      + RentDate + "'," +
                                " dueDate = '"       + DueDate  + "' " +
                                " WHERE itemID = '"  + id       + "'";



                  int rc = stmt.executeUpdate(sql);
                  return true;
            }catch(SQLException e){
                  while(e!=null){
                        System.out.println("Item rented by user Update error " + e.getMessage());
                        e = e.getNextException();
                  }
            }
            return ok;
      }
      /********BOOKING FUNCTION**************************************/
      public static boolean AddNewBooking( String bookId ,String cusNo,
      String bookDate,String pickupDate,String pickupTime,String processed )//works ok
      {
      boolean done = false;
      try{
            String sql  = "INSERT INTO booking VALUES ('" +
                                                            bookId        + "','"  +
                                                            cusNo         + "','"  +
                                                            bookDate      + "','"  +
                                                            pickupDate    + "','"  +
                                                            pickupTime    + "','"  +
                                                            processed     + "')";


                         int rc = stmt.executeUpdate(sql);
                         System.out.println("done");
                        return true;
                  }
                  catch(SQLException e)
                  {
                        while(e!=null)
                        {
                              System.out.println("AddNewBooking INSERT ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return done;
      }/******************************************************/
      public static boolean deleteBooking(String id)
      {
                  boolean ok = false;
                  try{
                        String sql = "DELETE FROM booking  " +
                              "WHERE bookingID = '" + id  + "'";

                        int rc = stmt.executeUpdate(sql );
                        return true;
                  }catch(SQLException e){
                        while(e!=null){
                              System.out.println("deleteBooking ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return ok;
      }
      //**********METHODS TO CREATE BOOK DATABASE TABLES***************//
      public static boolean UpdateBooking( String processed,String book )
      {//works ok

                  boolean ok = false;
                  try{
                        String sql  = "UPDATE booking Set " +
                                            " processed ='" + processed  + "' " +
                                            " WHERE bookingID = '"  + book + "'";


                              int rc = stmt.executeUpdate(sql);
                              return true;
                        }catch(SQLException e){
                              while(e!=null){
                                    System.out.println("Item return Update ERROR " + e.getMessage());
                                    e = e.getNextException();
                              }
                        }
            return ok;
      }/****************************************************************/
      public static boolean UpdateBookingItem( String bookID,String itemID )
      {//works ok

            boolean ok = false;
            try{
                  String sql  = "INSERT INTO bookedItem VALUES ('"  +
                                                                     bookID         + "','"  +
                                                                     itemID         + "')";
                        int rc = stmt.executeUpdate(sql);
                        return true;
                  }catch(SQLException e){
                        while(e!=null){
                              System.out.println("BookingItem table  was not Updated ERROR " + e.getMessage());
                              e = e.getNextException();
                        }
                  }
                  return ok;
      }/************************************************************/
      public static ResultSet getBookedItemsFromDataBase(String cstID,String date)
      {//query for proccessing orders
      try{
                  String sql = "SELECT * FROM booking bookingID, customerNo, bookDate, pickupDate, pickupTime WHERE customerID = '" + cstID  + "' " + " AND customerID = '" +  date   + "'";

                  results = stmt.executeQuery(sql);

                  }catch(Exception e){
                  System.out.println("SQL ERROR: " + e.toString());
                  }
                  return results;

      }
    /*********************************************************************/
      public static String getMaxVHSID()
      {
            String id="";
            try{
                  String sql = "SELECT MAX(itemID) from item";

                  results = stmt.executeQuery(sql);

                  if(results.next())
                        id = results.getString( 1 );
                  else
                        id = "VHS00000";
                  con.commit();
                  }
                        catch(Exception e)
                        {
                              System.out.println("SQL ERROR1: " + e.toString());
                        }
                  return id;
    }
    public static String getMaxDVDID()
            {
                  String id="";
                  try{
                        String sql = "SELECT MAX(itemID) from item";

                        results = stmt.executeQuery(sql);

                        if(results.next())
                              id = results.getString( 1 );
                        else
                              id = "DVD00000";
                        con.commit();
                        }
                              catch(Exception e)
                              {
                                    System.out.println("SQL ERROR1: " + e.toString());
                              }
                        return id;
    }
    public static String getMaxGAMID()
            {
                  String id="";
                  try{
                        String sql = "SELECT MAX(itemID) from item";

                        results = stmt.executeQuery(sql);

                        if(results.next())
                              id = results.getString( 1 );
                        else
                              id = "GAM00000";
                        con.commit();
                        }
                              catch(Exception e)
                              {
                                    System.out.println("SQL ERROR1: " + e.toString());
                              }
                        return id;
    }
      /*******************************************************************/
    public static String getMaxCustomerID()
    {
      String id="";
      try{
            String sql = "SELECT MAX(customerID) from customer";

            results = stmt.executeQuery(sql);

            if(results.next())
                  id = results.getString( 1 );
            else
                  id = "CST00000";
            con.commit();
            }
                  catch(Exception e)
                  {
                        System.out.println("SQL ERROR1: " + e.toString());
                  }
            return id;
    }/*************************************/
    public static String getMaxBookingID()
      {
            String id="";
            try{
                  String sql = "SELECT MAX(bookingID) from booking";

                  results = stmt.executeQuery( sql );

                  if(results.next())
                  {
                        id = results.getString( 1 );
                  }
                  else
                  {
                        id = "BOK00000";
                  }
                  con.commit();
                  }
                        catch(Exception e)
                        {
                              System.out.println("SQL ERROR1: " + e.toString());
                        }
                  return id;
    }
    public static String getMaxItemID()
            {
                  String id="";
                  try{
                        String sql = "SELECT MAX(itemID) from item";

                        results = stmt.executeQuery( sql );

                        if(results.next())
                        {
                              id = results.getString( 1 );
                        }
                        else
                        {
                              id = "VHS00000";
                        }
                        //      id = "DVD00000";
                        //      id = "GAM00000";
                        con.commit();
                        }
                              catch(Exception e)
                              {
                                    System.out.println("SQL ERROR1: " + e.toString());
                              }
                        return id;
    }
  //**********CLOSE STATEMENT AND CONNECTION******************************//
      public static void closeDatabase()//works ok
      {
            try{
                  stmt.close();
                  con.close();
                  System.out.println("DataBase Closed");
            }catch(Exception e)
            {
                  System.out.println("Already closed");
            }

      }
//**********LOADS DRIVER, CREATES CONNECTION AND STATEMENT***************//
      public static void connectToDatabase()//works ok
      {

            //For Access database
            String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
            String url   = "jdbc:odbc:B215ASSIGN";
            String username = "";
            String password = "";


            try {
            System.out.println("DataBase connected");
                        //Loads and register required Driver
                        Class.forName (driver);
                        // Attempt to create connection to database.
                        con = DriverManager.getConnection(url, username, password);
                        //creates statement to send queries and return results
                        stmt = con.createStatement ();
                  } catch (SQLException ex)
                  {
                        while (ex != null)
                        {
                              System.out.println ("SQL Exception:  " + ex.getMessage ());
                              ex = ex.getNextException ();
                        }
                  } catch (java.lang.Exception ex)
                  {
                        ex.printStackTrace ();
                  }
      }

}

********************************************************************************************************************************************************************************when compiling the Customer.java class i get this error


C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:240: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
        Ass2Data.connectToDatabase();
        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:242: cannot resolve symbol
symbol  : method getNewID  ()
location: class video.Customer
                   getNewID(),
                         ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:241: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
          if( Ass2Data.AddNewCustomer(
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:258: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
                   Ass2Data.closeDatabase();
                        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:263: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
                  Ass2Data.closeDatabase();
                        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:269: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.connectToDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:270: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            if( Ass2Data.ChangePass( getPassword(), getId() ))
                    ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:274: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:279: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
      Ass2Data.connectToDatabase();
        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:280: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
      if(Ass2Data.updateCustomer(
           ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:298: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:303: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.connectToDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:306: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              if( Ass2Data.deleteCustomer( getId() ))
                      ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:310: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
          Ass2Data.closeDatabase();
        ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:321: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              Ass2Data.connectToDatabase();
                  ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:323: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
              ResultSet rs = Ass2Data.getSingleCustomer( s1  );
                                 ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:363: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
            Ass2Data.closeDatabase();
                ^
C:\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\video\Customer.java:365: cannot resolve symbol
symbol  : variable Ass2Data  
location: class video.Customer
       Ass2Data.closeDatabase();
        ^
18 errors

Tool completed with exit code 1
kupra1Commented:
You need to add the line.

import video.Ass2Data;

in the java clases wherever you are referencing the Ass2Data from some other class.
Dj_majAuthor Commented:
I did that and still does not work.
What could be the problem?ive been trying all combos and cant get it to compile.
tang_tzuchiGeneral ManagerCommented:
u try to compile the class Ass2Data first then u continue to compile the Customer class....
i think this should be the correct order....
if your using java compiler like Jcreator or Jboss then you can add both file to project then compile togather.....

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.