我按一下方法建立了Entity Bean为什么报错?????
Working with entity beans
For this exercise, enter the name of the project as TestEntProject in the directory
E:\Demo\WebLogic\TestEntProject and enter the EJB module name as TestEntMod.
jdsserver.jar from <JBuilder8_Installed_Dir>\lib.
Right-click on the editor pane. Click Import Schema from Database. That brings up the
Database Schema Provider window. Enter the Database Driver, URL, Username,
Password, and JNDI name.
Driver: com.borland.datastore.jdbc.DataStoreDriver
URL:
jdbc:borland:dsremote://localhost//E:\Borland\JBuilder8\samples\JData
Store\datastores\employee.jds
JNDI name: JDSDataSource
Username: Sample
Password: <leave this empty>
For this exercise, let’s create a CMP 2.0 Entity Bean for EMPLOYEE Table. Right-click
EMPLOYEE from the structure pane and click Create CMP 2.0 Entity Bean. This creates a
Visual Employee Entity Bean in the editor pane.
Add a method (right-click EmployeeSes in the editor pane, click add, click method) to
EmployeeSes and provide the following parameters.
Method name: getEmpName
Return type: String
Input parameters: Short empNo
Interfaces: remote
public String getEmpName(Short empNo) {
String empName = "name not found";
try {
javax.naming.Context context = new
javax.naming.InitialContext();
Object object = context.lookup("java:comp/env/ejb/Employee");
EmployeeHome empHome = (EmployeeHome)
javax.rmi.PortableRemoteObject.narrow(object, EmployeeHome.class);
Employee emp = empHome.findByPrimaryKey(empNo);
empName = emp.getFirstName() + " " + emp.getLastName();
}catch (NamingException ex) {
ex.printStackTrace();
}catch (ClassCastException ex) {
ex.printStackTrace();
}catch (Exception ex){
ex.printStackTrace();
}
return empName;
}