Advertisement
SayeedSalam

PMF.java

Aug 28th, 2012
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package practiceJDO;
  2.  
  3. import java.io.FileInputStream;
  4. import java.io.FileNotFoundException;
  5.  
  6. import javax.jdo.JDOHelper;
  7. import javax.jdo.PersistenceManagerFactory;
  8.  
  9.  
  10.  
  11. public class PMF {
  12.  
  13.     private static PersistenceManagerFactory factory ;
  14.    
  15.     protected PMF(){}
  16.    
  17.     public static PersistenceManagerFactory getInstance()
  18.     {
  19.         if(factory==null)
  20.             try {
  21.                 factory=JDOHelper.getPersistenceManagerFactory(new FileInputStream("datanucleus.properties"));
  22.             } catch (FileNotFoundException e) {
  23.                 // TODO Auto-generated catch block
  24.                 e.printStackTrace();
  25.             }
  26.            
  27.         return factory ;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement