我正在编写 ejb 3.0 教程,我想在设置运行时将数据添加到数据库中,它不会指示任何错误,也不会在数据库中添加以下数据:这是会话 bean 代码:
public String creerCompte(CompteBancaire c) {
 try{
  em.persist(c);
  return null;
  }catch (Exception ex) {
        return ex.getLocalizedMessage();
    }
}
public static void main(String[] args) throws Exception{
GestionnaireDeCompteBancaire g=new GestionnaireDeCompteBancaire();
CompteBancaire c=new CompteBancaire("John Lennon", 150000);
g.creerCompte(c);}
方法 main 只是为了尝试方法 creercompte out