You are on page 1of 13

Bi 6: Bean-Managed Persistent Entity Beans

I. Khi nim 1. Bean-Managed Persistence - Vi BMP, ngi vit bean phi vit tng minh cc triu gi dng truy xut c s d liu. Truy xut d liu c th c m ha bn trong bean hoc ng gi trong i tng truy xut d liu nh mt phn ca EJB Container
Bean-Managed Persistence EJB

JDBC/SQLJ

JDBC Driver

SQL Database

bean. - BMP c chn dng khi: Mun iu khin hon ton vic truy xut c s d liu, nh vit cc truy vn ti u. Mun vit thao tc truy xut cho cc h qun tr c s d liu c, ERP Ni lu tr khng phi l mt h qun tr c s d liu. Tuy nhin, mi lin h qu cht ch gia BMP v c s d liu n thao tc trn l mt yu im ca BMP. - BMP cng nh cc Entity Bean khc, c 3 trng thi: Does Not Exits: khng tn ti trong b nh. Pooled: c mt trong instance pool nhng cha sn sng hot ng. Ready: sn sng p ng cc yu cu t client cho EJB Object y nhim n. 2. Vng i ca Entity Bean - Vng i ca bean bt u khi container gi Does Not Exist Class.newInstance(), sau lin kt bean vi i tng cha thng tin mi trng bng cch gi phng thc setEntityContext(), bean hnh thnh Object.finalize() Class.newInstance() v c t vo instance pool (trng thi Pooled). unsetEntityContext() setEntityContext(ec) Bean trong pool khng lin kt vi bt k c s d liu v mt EJB Object no, container c th dng bean ny thc hin bt k mt phng thc home Pooled hoc finder no. ejbHome<METHOD>() ejbFind<SUFFIX>() - Khi container chn bean phc v mt triu gi ca ejbSelect<SUFFIX>() client n EJB Object, bean chuyn sang trng thi Ready, lin kt vi c s d liu v vi EJB Object c ejbCreate() ejbActivate() th. C hai cch chuyn n trng thi Ready: ejbPassivate() ejbRemove() ejbPostCreate() Client gi phng thc create() ca Home Object v nh vy container s gi ln lt cc phng thc ejbCreate() v ejbPostCreate(). Ready Container gi phng thc ejbActivate() ejbLoad() kch hot li cc bean ang th ng, cp ejbSelect<SUFFIX>() pht ti nguyn nh sockect cho bean.. business method - Trong trng thi Ready, bean lin kt vi mt EJB Object. Container gi cc business method trn bean, ejbStore() c EJB Object y nhim n. Container cng ng b trng thi ca bean vi c s d liu bng cch dng cc phng thc ejbLoad() v ejbStore(). - Container c th chuyn bean tr li trng thi Pooled, iu ny xy ra khi: Client gi phng thc remove() v nh vy container s gi phng thc ejbRemove(). Container gi phng thc ejbPassivate() chuyn bean sang trng thi th ng. - Cui vng i ca bean, container s loi bean ra khi pool v gi phng thc unsetEntityContext() tch bean ra khi i tng cha thng tin mi trng lin quan n n. 3. Cc phng thc callback v cc Finder
1

- Phng thc ejbCreate() c gi khi ghi trng thi ca bean vo c s d liu, bean lin kt vi i din EJB Object ca n. Nh vy mt hng mi c to v c ghi vo c s d liu. c t EJB t 2.0 tr i cho php np chng phng thc ny di dng ejbCreate<SUFFIX>(), cn c phng thc create<SUFFIX>() tng ng trong home interface. Lnh SQL tng ng l INSERT. - Phng thc ejbPostCreate() c gi sau khi gi ejbCreate(). Phng thc ny dng cho mt s tc v nh: gii quyt cc vn pht sinh khi chn hng vo c s d liu, thit lp mi quan h gia cc bean c lin quan vi nhau sau khi chng hnh thnh, chuyn tham chiu ca bean n mt bean khc, thay i cc thng s transaction, ... - Phng thc ejbRemove() dng tch mi lin kt gia bean vi d liu tng ng trong c s d liu. Lnh SQL tng ng l DELETE. - Phng thc ejbLoad() dng np d liu t c s d liu vo bean tng ng (cn gi l refresh d liu), ng b trng thi ca bean vi hng d liu m n nh x. Phng thc ny c gi trc khi cc business method c thc hin. Lnh SQL tng ng l SELECT. - Phng thc ejbStore() dng ghi trng thi (d liu ca lp bean) vo c s d liu, ng b trng thi ca bean vi hng d liu m n nh x. Phng thc ny c gi sau khi business method thc hin xong. Lnh SQL tng ng l UPDATE. - Phng thc setEntityContext() dng lin kt bean vi i tng javax.ejb.EntityContext. Thng qua i tng ny nhn nhng thng tin lin quan n mi trng. - Phng thc unsetEntityContext() tch bean khi mi trng, gii phng ti nguyn do setEntityContext() cp, thc th bean sn sng hy. - Mi phng thc c tn find<SUFFIX>() trong home interface, phi c mt phng thc ejbFind<SUFFIX>() tng ng vi cng i s trong lp bean. Khi mt phng thc find() c triu gi trn Home Object, container s y nhim phng thc ejbFind() tng ng trn bean thc hin yu cu. Kt qu tr v ca cc phng thc find() l mt i tng kiu EJB Object hoc mt Collection cc i tng kiu EJB Object, trong lc kt qu tr v ca cc phng thc ejbFind() l kha chnh hoc mt Collection cc kha chnh. 4. Hot ng ca Entity Bean

JNDI Service
2. lookup n home trong JNDI 1. ng k EJB Cc phng thc callback

3. create

Client

4. Gi cc business method 5. remove

Home Object

3.1 To bean 4.1 Gi cc business method 5.1 ejbRemove Entity Bean ejbLoad EJB Object ejbStore ejbPassivate ejbActivate JDBC/SQLJ
JDBC Driver

Container

SQL

1. Container ng k tt c cc bean c trin khai vi JNDI. 2. Client tm thy (lookup()) home interface ca bean thng qua JNDI. 3. Client dng home interface to ra EJB Object. Khi client triu gi phng thc create() ca home interface, container triu gi phng thc ejbCreate() tng ng ca bean. 4. Client triu gi cc business method trn EJB Object, container y nhim cc li gi ny n bean.
2

Database

5. Client gi phng thc remove() ca EJB Object, container gi ejbRemove() ca bean tng ng. Container ng b trng thi ca bean vi c s d liu bng cch dng cc phng thc ejbLoad() v ejbStore(). 5. Lp Primary Key (kha chnh) - Primary Key l mt i tng dng ch nh duy nht mt entity bean. Primary Key c th l kiu serializable bt k no, bao gm cc kiu c sn (Integer, Double, String, ...) hoc cc lp c nh ngha bi ngi pht trin bean. - C hai kiu Primary Key: Single-Field: Primary Key nh x vi mt field nh ngha trong lp bean. Compound: lp Primary Key (ci t giao din java.io.Serializable) do ngi dng nh ngha nh x n nhiu field trong lp bean. - V d Coumpound Primary Key:
public class ShipPK implements java.io.Serializable { public String name; public String registration; public ShipPK() { } public ShipPK( String name, String registration ) { this.name = name; this.registration = registration; } public String getName() { return name; } public String getRegistration( ) { return registration; } public boolean equals( Object obj ) { if ( obj == null || !( obj instanceof ShipPK ) ) return false; ShipPK other = ( ShipPK )obj; if ( this.name.equals(other.name) && this.registration.equals( other.registration ) ) return true; else return false; } public int hashCode() { return name.hashCode( )^registration.hashCode( ); } public String toString( ) { return name+" "+registration; } }

Ch khi to lp Primary Key: Phi ci t giao din java.io.Serializable. Cc field phi public. Cn nh ngha cc phng thc equals() v hashCode() ch nh Primary Key trong Collection. - Phng thc findByPrimaryKey() ca home interface nhn i s l mt Primary Key v tr v mt i tng kiu remote interface:
public Ship findByPrimaryKey( RemoteException; ShipPK primarykey )throws FinderException,

- Lp bean phi c nhng field tng ng vi d liu ring ca lp Primary Key. Phng thc ejbCreate() ca lp bean cng tr v mt i tng Primary Key:
public ShipPK ejbCreate( String name, String registration ) { setName( name ); setRegistration(registration); // database insert logic return new ShipPK( name, registration ); } public void ejbPostCreate( String name, String registration ) { }

- Deployment Descriptor cng phi nh ngha lp Primary Key cn cho trin khai:
<prim-key-class>cShipPK</prim-key-class>
3

II. Thit k
A. To BMP 1. To remote interface
package student; import java.rmi.RemoteException; import javax.ejb.EJBObject; public interface StudentRemote extends EJBObject{ public String getName() throws RemoteException; public String getStudentId() throws RemoteException; public void setName(String name) throws RemoteException; }

2. To home interface
package student; import java.rmi.RemoteException; import java.util.Enumeration; import import import public javax.ejb.CreateException; javax.ejb.EJBHome; javax.ejb.FinderException; interface StudentRemoteHome extends EJBHome{ public StudentRemote create(String StudentId,String name)throws CreateException, RemoteException; public StudentRemote findByPrimaryKey(String StudentId)throws FinderException, RemoteException; public Enumeration findByName(String name)throws FinderException, RemoteException; }

3. Lp Primary Key (kha chnh) - Primary Key nh ngha thuc tnh dng nh v mt hng d liu (tc mt bean) trong c s d liu. Thng ch cn mt thuc tnh, nhng i khi cn mt b thuc tnh mi xc nh c mt hng duy nht trong bng. Nu Primary Key ch l kiu serializable c sn th khng cn phi vit lp Primary Key. 4. To lp EJB - Lp EJB cho BMP vit phc tp v ngi cung cp bean phi chu trch nhim truy xut c s d liu. Bao gm: D liu ring (cc field) v cc accesors/mutators (cc business method) Cc phng thc h tr Cc phng thc callback v cc Finder a) D liu ring ca bean v cc accesor - Bean phi c d liu ring, chnh l th hin cc field ca hng d liu m bean nh x trong n. D liu ring ny c truy xut (vo/ra) bi cc getter/setter (gi chung l cc accessor). y cng l cc business method c client triu gi. Tip u ng set/get l quy c, khng phi bt buc.
private String studentId; private String name; public String getName() { return name; } public String getStudentId () { return studentId; } public void setName( String name ) { this.name = name; }

b) Phng thc h tr - d ci t, nn vit trc cc phng thc h tr (helper method, cn gi l utility method). Cc phng thc ny ch dng trong lp nn phm vi truy xut thng l private. Bao gm: To kt ni c s d liu: kt ni ny lu trong i tng Connection, d liu ring ca bean. Kt ni c s d liu c thc hin thng qua JDBC-ODBC private Connection makeConnection() throws Exception{ Connection con=null;
4

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url="jdbc:odbc:student"; con=DriverManager.getConnection(url); return con; } Cc phng thc dng chn hoc xa mt hng d liu ca bng, s c dng cho cc phng thc ejbCreate() (chn, lnh SQL insert) v ejbRemove() (xa, lnh SQL delete) ca bean.
private void insertStudent(String studentId, String name) throws Exception{ Connection con=makeConnection(); String sql="insert into Student values(?,?)"; PreparedStatement pSt=con.prepareStatement(sql); pSt.setString(1, studentId); pSt.setString(2, name); pSt.executeUpdate(); pSt.close(); con.close(); } private void deleteStudent(String studentId) throws Exception{ Connection con=makeConnection(); String sql="delete from Student where studentID='"+studentId+"'"; con.createStatement().executeUpdate(sql); con.close(); }

Cc phng thc dng np hoc lu mt hng d liu ca bng, s c dng cho cc phng thc ejbLoad() (lnh SQL select) v ejbStore() (lnh SQL update) ca bean.

private void storeStudent() throws Exception{ Connection con=makeConnection(); String sql="update Student set name=? where studentId=?"; PreparedStatement pSt=con.prepareStatement(sql); pSt.setString(1, studentId); pSt.setString(2, name); int effectedRows=pSt.executeUpdate(); pSt.close(); con.close(); if(effectedRows<1) throw new Exception("Storing row for studentId:"+studentId+" failed."); } private void loadStudent() throws Exception{ Connection con=makeConnection(); String sql="select * from Student where studentID='"+studentId+"'"; ResultSet rs=con.createStatement().executeQuery(sql); if(rs.next()){ this.name=rs.getString("name"); } else{ throw new Exception("Row for student id:"+studentId+" not found in database"); } }

c) Cc phng thc callback v cc Finder - m t phn trn. d) Code hon chnh


package student; import java.rmi.RemoteException;
5

import import import import import import import import import import import import import

java.sql.Connection; java.sql.DriverManager; java.sql.PreparedStatement; java.sql.ResultSet; java.util.Enumeration; java.util.Properties; java.util.Vector; javax.ejb.CreateException; javax.ejb.EJBException; javax.ejb.EntityBean; javax.ejb.EntityContext; javax.ejb.FinderException; javax.ejb.ObjectNotFoundException;

public class StudentBean implements EntityBean{ private static final long serialVersionUID = 1L; protected EntityContext context; //Environment properties public Properties env; //Bean-Managed states fields private String studentId; private String name; //================================================== //default constructor public StudentBean(){ System.out.println ("EJB created..."); } //Setters/getters public void setStudentId(String studentId){ this.studentId=studentId; } public String getStudentId(){ return this.studentId; } public void setName(String name){ this.name=name; } public String getName(){ return this.name; } //================================================== //Tao Student trong database public String ejbCreate(String studentId,String name) throws CreateException{ try { insertStudent(studentId,name); this.studentId=studentId; this.name=name; } catch (Exception ex) { throw new EJBException("ejbCreate: "+ex.getMessage()); } return studentId; } public void ejbPostCreate( String studentId, String name ) { } public String ejbFindByPrimaryKey(String studentId) throws FinderException{ boolean result=false; System.out.println ("in ejbFindByPrimaryKey"); try { result=findByPrimaryKey(studentId); }
6

catch (Exception ex) { throw new EJBException("ejbFindByPrimaryKey"+ex.getMessage()); } if(!result) throw new ObjectNotFoundException("row for id "+studentId+" not found!"); return studentId; } public Enumeration ejbFindByName(String name) throws FinderException{ Enumeration a=null; try { a= FindByName(name); } catch (Exception e) { e.printStackTrace(); } return a; } public void ejbRemove(){ System.out.println ("in ejbRemove..."); try { deleteStudent(studentId); } catch (Exception ex) { throw new EJBException("ejbRemove: "+ex.getMessage()); } System.out.println ("leaving ejbRemove"); } public void setEntityContext(EntityContext context){ this.context=context; } public void unsetEntityContext() throws EJBException, RemoteException { this.context=null; this.env=null; } public void ejbActivate() throws EJBException, RemoteException { this.studentId=(String)context.getPrimaryKey(); } public void ejbPassivate() throws EJBException, RemoteException { this.studentId=null; } public void ejbLoad(){ try { loadStudent(); } catch (Exception ex) { throw new EJBException("ejbLoad: "+ex.getMessage()); } } public void ejbStore() throws EJBException, RemoteException { try { storeStudent(); } catch (Exception e) { e.printStackTrace(); }//update } //========================================================== private Connection makeConnection() throws Exception{
7

Connection con=null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url="jdbc:odbc:student"; con=DriverManager.getConnection(url); return con; } //-----------------------------------------/** * T?m theo kha chnh * @param studentId: l mssv cn t?m * @return: true nu t?m thy * @throws Exception */ private boolean findByPrimaryKey(String studentId) throws Exception{ Connection con=makeConnection(); String sql="select * from Student where studentID='"+studentId+"'"; ResultSet rs=con.createStatement().executeQuery(sql); boolean ret=rs.next();con.close(); return ret; } /** * T?m theoi tn * @param name: l tn cn t?m * @return danh sch cc sinh vin c tn l $name */ private Enumeration FindByName(String name) throws Exception{ Vector vec=new Vector(); Connection con=makeConnection(); String sql="select * from Student where name='"+name+"'"; ResultSet rs=con.createStatement().executeQuery(sql); while(rs.next()) vec.add(rs.getString("studentId")); con.close(); return vec.elements(); } /** * Xa 1 SV khi CSDL * @param studentId l mssv c?n xa * @throws Exception */ private void deleteStudent(String studentId) throws Exception{ Connection con=makeConnection(); String sql="delete from Student where studentID='"+studentId+"'"; con.createStatement().executeUpdate(sql); con.close(); } /** * Thm 1 sinh vin vo csdl * @param studentId: l mssv cn thm * @param name: tn sv cn thm * @throws Exception */ private void insertStudent(String studentId, String name) Exception{ Connection con=makeConnection(); String sql="insert into Student values(?,?)"; PreparedStatement pSt=con.prepareStatement(sql); pSt.setString(1, studentId); pSt.setString(2, name); pSt.executeUpdate(); pSt.close(); con.close(); }
8

throws

/** * Update thngng tin sinh vin */ private void storeStudent() throws Exception{ Connection con=makeConnection(); String sql="update Student set name=? where studentId=?"; PreparedStatement pSt=con.prepareStatement(sql); pSt.setString(1, studentId); pSt.setString(2, name); int effectedRows=pSt.executeUpdate(); pSt.close(); con.close(); if(effectedRows<1) throw new Exception("Storing row for studentId:"+studentId+" failed."); } /** * Load thng tin ca 1 sinh vin */ private void loadStudent() throws Exception{ Connection con=makeConnection(); String sql="select * from Student where studentID='"+studentId+"'"; ResultSet rs=con.createStatement().executeQuery(sql); if(rs.next()){ this.name=rs.getString("name"); } else{ throw new Exception("Row for student id:"+studentId+" not found in database"); } } }

- Trong BMP, khi container chuyn bean t trng thi Pooled sang trng thi Ready s khng t ng thit lp kha chnh. V vy, cc phng thc ejbCreate() v ejbActivate() cn phi thit lp kha chnh, l l do cn lu tr i tng EntityContext. B. To client truy xut Stateless Session Bean - Tng t nh vit phn client cho Session Bean.
package client; import import import import import import import import import import import import import import import import java.awt.BorderLayout; java.awt.Color; java.awt.event.ActionEvent; java.awt.event.ActionListener; java.util.Enumeration; javax.naming.Context; javax.naming.InitialContext; javax.rmi.PortableRemoteObject; javax.swing.Box; javax.swing.JButton; javax.swing.JFrame; javax.swing.JLabel; javax.swing.JScrollPane; javax.swing.JTable; javax.swing.JTextField; javax.swing.table.DefaultTableModel;

import student.StudentRemote; import student.StudentRemoteHome;


9

public class Client extends JFrame implements ActionListener{ private static final long serialVersionUID = 1L; private JTextField tfID,tfName; private JButton btAdd,btFindById,btFindByName; private DefaultTableModel dtm; private JTable table; private StudentRemoteHome studentHome; private JLabel lblStatus; public Client(){ super("BMP demontraction"); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(400,250);setResizable(false); Box b=Box.createVerticalBox(); Box b1=Box.createHorizontalBox(); Box b2=Box.createHorizontalBox(); Box b3=Box.createHorizontalBox();b.add(Box.createVerticalStrut(8)); b.add(b1); b.add(Box.createVerticalStrut(8)); b.add(b2);b.add(Box.createVerticalStrut(8)); b.add(b3);b.add(Box.createVerticalStrut(8)); this.add(b,BorderLayout.NORTH); JLabel l1,l2; b1.add(l1=new JLabel("Student ID:",JLabel.RIGHT)); b1.add(tfID=new JTextField(20)); b2.add(l2=new JLabel("Name:",JLabel.RIGHT)); b2.add(tfName=new JTextField(20)); l2.setPreferredSize(l1.getPreferredSize()); b3.add(btAdd=new JButton("Add"));b3.add(Box.createHorizontalStrut(5)); b3.add(btFindById=new JButton("Find By ID"));b3.add(Box.createHorizontalStrut(5)); b3.add(btFindByName=new JButton("Find By Name")); btAdd.addActionListener(this); btFindById.addActionListener(this); btFindByName.addActionListener(this); lblStatus=new JLabel("infos...");lblStatus.setForeground(Color.red); this.add(lblStatus,BorderLayout.SOUTH); createTable(); DoLook(); } private void DoLook() { try { System.setProperty( "java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ); System.setProperty( "java.naming.provider.url", "localhost:1099" ); System.setProperty( "java.naming.factory.url.pkgs", "org.jboss.naming" ); Context ctx = new InitialContext(); Object ref = ctx.lookup( "Student" ); studentHome = ( StudentRemoteHome )PortableRemoteObject.narrow( ref, StudentRemoteHome.class ); } catch ( Exception e ) { e.printStackTrace();
10

} } private void createTable() { String []hd={"Student ID","Name"}; dtm=new DefaultTableModel(hd,0); table=new JTable(dtm); this.add(new JScrollPane(table),BorderLayout.CENTER); } public static void main(String[] args) { new Client().setVisible(true); } @Override public void actionPerformed(ActionEvent e) { Object o=e.getSource(); if(o.equals(btAdd)){ String id=tfID.getText(); String name=tfName.getText(); if(id.trim().equals("")||name.trim().equals("")) lblStatus.setText( "Fields cannot be null!\nPlease enter it"); else { try { studentHome.create(id, name); lblStatus.setText("Create new item successfully!"); } catch (Exception e1) { lblStatus.setText("Can not be create new Item"); } } } else if(o.equals(btFindById)){ StudentRemote student=null; dtm.setRowCount(0); try { student=studentHome.findByPrimaryKey(tfID.getText()); if(student!=null){ String []tmp=new String[2]; tmp[0] = student.getStudentId(); tmp[1] = student.getName(); dtm.addRow( tmp ); } } catch (Exception e1) { lblStatus.setText(e1.getMessage()); } } else if(o.equals(btFindByName)){ String[] tmp = new String[2]; StudentRemote student = null; dtm.setRowCount(0); try { Enumeration en = studentHome.findByName( tfName.getText() ); if ( e != null ) { while ( en.hasMoreElements() ) { student = (StudentRemote)en.nextElement(); tmp[0] = student.getStudentId(); tmp[1] = student.getName(); dtm.addRow( tmp ); } } else { lblStatus.setText( "Could not find" ); }
11

} catch ( Exception ex ){ lblStatus.setText(ex.getMessage()); } } } }

III. Trin khai 1. Chun b cc deployment descriptor - Chun b ejb-jar.xml trong th mc META-INF. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd"> <ejb-jar> <display-name>emp</display-name> <enterprise-beans> <entity> <ejb-name>Student</ejb-name> <home>student.StudentRemoteHome</home> <remote>student.StudentRemote</remote> <ejb-class>student.StudentBean</ejb-class> <persistence-type>Bean</persistence-type> <prim-key-class>java.lang.String</prim-key-class> <reentrant>false</reentrant> </entity> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>Student</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> - Chun b jboss.xml trong th mc META-INF. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd"> <jboss> <enterprise-beans> <entity> <ejb-name>Student</ejb-name> <jndi-name>Student</jndi-name> </entity> </enterprise-beans> </jboss> 2. ng gi EJB - Dng cng c jar ng gi EJB
C:\EJB\BMP> jar cvf Student.jar student/*.class META-INF/*.xml added manifest adding: student/StudentRemote.class(in = 302) (out= 204)(deflated 32%) adding: student/StudentBean.class(in = 5908) (out= 2775)(deflated 53%)
12

adding: student/StudentRemoteHome.class(in = 485) (out= 271)(deflated 44%) adding: META-INF/ejb-jar.xml(in = 535) (out= 224)(deflated 58%) adding: META-INF/jboss.xml(in = 262) (out= 137)(deflated 47%) - Kt qu gi student.jar c ni dung nh sau: student StudentRemote.class StudentBean.class StudentRemoteHome.class META-INF ejb-jar.xml jboss.xml MANIFEST.MF

2. To c s d liu - To c s d liu bt k, to bng student vi design nh sau:

Nhp trc mt s record th Ci t mt DSN tn l student: 3. Trin khai gi student.jar: - Sao chp gi student.jar vo th mc %JBOSS_HOME%\server\default\deploy

4. S dng client truy xut EJB - cn c cc gi ni trong bi Session Bean

13

You might also like