----- Original Message ----- From: "sam wun" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Tuesday, August 26, 2008 2:02 PM
Subject: Can't generate class file from Interface


Hi,



In Eclipse 3.4 (not sure about the previous version), I have a project, in
the src, there is a interface file called "DatabaseCommand.java". This file
is an interface file.

It s content is shown below:

package command;

import java.sql.Connection;
import java.sql.SQLException;

public interface DatabaseCommand {
public Object executeDatabaseOperation(Connection conn) throws
SQLException ;
}





Another file CreateOrder.java *implements* this interface.

Its content shown as below:



Package command;
**** NOT A KEY WORD ****
So they not in the same package, so there is no import command.DatabaseCommand, so its unhappy ;)
Not really a tomcat thing... but we friendly ;)


import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSet;
import java.util.ArrayList;
import domain.Customer;

/**
* List existing customers in the database
*/

public class ListCustomers implements DatabaseCommand {

public Object executeDatabaseOperation(Connection conn) throws
SQLException {
// List customers in the database

ArrayList<Customer> list = new ArrayList<Customer>();
Statement sta = conn.createStatement();
ResultSet rs = sta.executeQuery("SELECT ID, FIRST_NAME,
LAST_NAME, ADDRESS FROM CUSTOMER");
while(rs.next()) {
Customer cust = new Customer();
cust.setId(rs.getInt(1));
cust.setFirstName(rs.getString(2));
cust.setLastName(rs.getString(3));
cust.setAddress(rs.getString(4));
list.add(cust);
}

rs.close();
sta.close();

return list;
}
}



When I press Clt-B to build the project(All), DatabaseCommand.java does not
get compiled, no DatabaseCommand.class generated in the
build\classes\command\ directory. The syntax highlithed in the
CreateOrder.java file indicated that DatabaseCommand is an unknown type,
that meant no class found.



How can I get around this issue? may be I should ask how to generate an
interface dot class file (eg. DatabaseCommand.class in this instance)?



Thanks

Sam
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to