Advertisement
uopspop

Untitled

Mar 28th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. package point;
  2.  
  3. import javax.jdo.JDOHelper;
  4. import javax.jdo.PersistenceManager;
  5. import javax.jdo.PersistenceManagerFactory;
  6. import java.util.Properties;
  7.  
  8. public class Main_Cook_Client {
  9. public static void main(String[] args) {
  10.  
  11. Properties props = new Properties();
  12. props.setProperty("javax.jdo.PersistenceManagerFactoryClass", "com.objectdb.jdo.PMF");
  13. props.setProperty("javax.jdo.option.ConnectionURL", "objectdb://localhost:6136/points005/points102.odb");
  14. props.setProperty("javax.jdo.option.ConnectionUserName", "user1");
  15. props.setProperty("javax.jdo.option.ConnectionPassword", "user1");
  16. PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props);
  17. PersistenceManager pm = pmf.getPersistenceManager();
  18.  
  19. pm.currentTransaction().begin();
  20. // Operations that modify the database should come here.
  21. for (int i = 1000; i < 1500; i++) {
  22. Cook c = new Cook(i, i, i);
  23. pm.makePersistent(c);
  24. }
  25. pm.currentTransaction().commit();
  26.  
  27. pm.close();
  28. pmf.close();
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement