Hi,friends
I used a EntityBean to maniapulate the coffees table in MS SQL server 2000.The interfaces and configuration is as below:
ejb-jar.xml
...
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CoffeesBean</ejb-name>
<home>example4/CoffeesHome</home>
<remote>example4/Coffees</remote>
<ejb-class>example4/CoffeesBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>false</reentrant>
<transaction-type>Container</transaction-type>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>CoffeesBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
<resource-ref>
<res-ref-name>jdbc/SQLServerPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
</ejb-jar>
...
home interface
...
public interface CoffeesHome extends javax.ejb.EJBHome {
public Coffees create() throws RemoteException, CreateException;
public Coffees findByPrimaryKey(String cofName) throws RemoteException, FinderException;
}
...
remote interface
...
public interface Coffees extends EJBObject {
public RowSet getCoffees() throws RemoteException, SQLException;
public void updateCoffees(RowSet rs) throws RemoteException, SQLException;
}
...
When i called updateCoffees,the system always reported "id may not be null".
Any suggestions are appreciated! IPO_z@cmmail.com
Garbage in,Garbage out
I used a EntityBean to maniapulate the coffees table in MS SQL server 2000.The interfaces and configuration is as below:
ejb-jar.xml
...
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CoffeesBean</ejb-name>
<home>example4/CoffeesHome</home>
<remote>example4/Coffees</remote>
<ejb-class>example4/CoffeesBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>false</reentrant>
<transaction-type>Container</transaction-type>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>CoffeesBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
<resource-ref>
<res-ref-name>jdbc/SQLServerPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
</ejb-jar>
...
home interface
...
public interface CoffeesHome extends javax.ejb.EJBHome {
public Coffees create() throws RemoteException, CreateException;
public Coffees findByPrimaryKey(String cofName) throws RemoteException, FinderException;
}
...
remote interface
...
public interface Coffees extends EJBObject {
public RowSet getCoffees() throws RemoteException, SQLException;
public void updateCoffees(RowSet rs) throws RemoteException, SQLException;
}
...
When i called updateCoffees,the system always reported "id may not be null".
Any suggestions are appreciated! IPO_z@cmmail.com
Garbage in,Garbage out