[jboss-user] [EJB 3.0] - Em.persist in loop

kaviarasu do-not-reply at jboss.com
Sat Dec 29 10:21:31 EST 2007


Hi i want to insert into database inside a loop
i have 3 values in a loop i want to insert into DB one by or it by any way 

here i paste my sample coding 

  | String product[];
  | for(String b:product)
  | {
  |   for(TblProducts _proname:getproducts )
  |   {
  |    if(_proname.getProductName().equalsIgnoreCase(b))
  |         {
  | 	productstore.setProductId(_proname);
  | 	em.persist(productstore);
  |          }
  |       }
  | }

the product is a array which has 2 or many values i want to insert one by one 
thank u in advance 
REgards
Kaviarasu

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116034#4116034

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116034



More information about the jboss-user mailing list