%BROADCASTMESSAGE%
CAAD | ARCH TWiki > Catch0405 > KaisersrotPersistenz > SoftwareVersions > KaisersrotDb-Eingabemaske > Gui-Pgm (r1.1) TWiki webs:
Admin| Aizo | Archinf | BIP | Bgyalex | Brandhub | Catch0405 | Cityscan05 | CommunityMedia | Control | Curtain | Easa005 | Easydb | Education | Extern | Extern0405 | Freudenhaus | Fund | Game0405 | Game05 | Gamearch | Luise | MAS0506 | MAS0506stu | Mas0506 | Mas0506stu | Maschinen0405 | Menz | Mill | Mill0405 | NDS | NDS0405 | NDS0405stu | Plugins | Qwipp | RZM | Replay | Replay0405 | Research | Second | Trash | Udintern | Urbandesign |
Catch0405 . { Changes | Index | Search | Go }
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.cfg.Configuration;

/*
 * Created on Dec 13, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Prefere nces - Java - Code Style - Code Templates
 */

/**
 * @author denis
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class StoreData {
   String store(String [] s) {

      try {

         //      Create the SessionFactory
         Configuration cfg = new Configuration().addClass(StoreTupel.class);
         SessionFactory factory = cfg.buildSessionFactory();
         //      Create the Session
         Session session = factory.openSession();
         //      Create the Transaction               
         Transaction tx = session.beginTransaction();

         //Create new User and store them the database
         StoreTupel storeTupel = new StoreTupel();
         //newUser1.setID("dr");
         storeTupel.setName(s[0]);
         storeTupel.setGeschlecht(s[1]);
         storeTupel.setAlter(s[2]);
         storeTupel.setBeruf(s[3]);
         storeTupel.setE_mail(s[4]);
         storeTupel.setTypGruppe(s[5]);
         storeTupel.setHausTyp(s[6]);
         storeTupel.setSize(s[7]);
         storeTupel.setAccessoires(s[8]);
         storeTupel.setPosVH(s[9]);
         storeTupel.setPosLR(s[10]);
         storeTupel.setGartenTyp(s[11]);
         storeTupel.setNStrasse(s[12]);
         storeTupel.setNBus(s[13]);
         storeTupel.setNWasser(s[14]);
         storeTupel.setNWald(s[15]);
         storeTupel.setNMarkt(s[16]);
         storeTupel.setNNachbar(s[17]);
         storeTupel.setNachbarName(s[18]);
         
         session.save(storeTupel);
         tx.commit();

         // close our session and release resources
         session.flush();
         session.close();
                  
      } catch (HibernateException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
      String returnString = "store successfully completed";
      return (returnString);
   }
}

-- OtherDenisRaschpichler - 15 Dec 2004


Topic Gui-Pgm . { Edit | Attach | Ref-By | Printable | Diffs | r1.2 | > | r1.1 | More }

Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

This website has been archived and is no longer maintained.