Package br.net.woodstock.rockframework.domain.persistence.orm

Examples of br.net.woodstock.rockframework.domain.persistence.orm.PersistenceException


  private JDBCWithJNDIPersistenceHelper() {
    super();
    try {
      InputStream inputStream = ClassLoaderUtils.getResourceAsStream(JDBCWithJNDIPersistenceHelper.PROPERTIES_FILE);
      if (inputStream == null) {
        throw new PersistenceException("File " + JDBCWithJNDIPersistenceHelper.PROPERTIES_FILE + " not found in classpath");
      }

      Properties properties = PropertiesReader.getPlainTextInstance().getProperties(inputStream);
      String dataSource = properties.getProperty(JDBCWithJNDIPersistenceHelper.PROPERTY_DATASOURCE);
      Context context = new InitialContext();
      this.dataSource = (DataSource) context.lookup(dataSource);
    } catch (Exception e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here


          c.close();
        }
        JDBCWithJNDIPersistenceHelper.connection.set(null);
      }
    } catch (SQLException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

        c = this.dataSource.getConnection();
        JDBCWithJNDIPersistenceHelper.connection.set(c);
      }
      return c;
    } catch (SQLException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

  private JDBCPersistenceHelper() {
    super();
    try {
      InputStream inputStream = ClassLoaderUtils.getResourceAsStream(JDBCPersistenceHelper.PROPERTIES_FILE);
      if (inputStream == null) {
        throw new PersistenceException("File " + JDBCPersistenceHelper.PROPERTIES_FILE + " not found in classpath");
      }

      Properties properties = PropertiesReader.getPlainTextInstance().getProperties(inputStream);
      DataSourceFactory factory = new BasicDataSourceFactory();
      this.dataSource = factory.getDataSource(properties);
    } catch (Exception e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

          c.close();
        }
        JDBCPersistenceHelper.connection.set(null);
      }
    } catch (SQLException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

        c = this.dataSource.getConnection();
        JDBCPersistenceHelper.connection.set(c);
      }
      return c;
    } catch (SQLException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

  private JDBCPersistenceHelper() {
    super();
    try {
      InputStream inputStream = ClassLoaderUtils.getResourceAsStream(JDBCPersistenceHelper.PROPERTIES_FILE);
      if (inputStream == null) {
        throw new PersistenceException("File " + JDBCPersistenceHelper.PROPERTIES_FILE + " not found in classpath");
      }

      Properties properties = PropertiesReader.getPlainTextInstance().getProperties(inputStream);
      DataSourceFactory factory = new BasicDataSourceFactory();
      this.dataSource = factory.getDataSource(properties);
    } catch (Exception e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

          c.close();
        }
        JDBCPersistenceHelper.connection.set(null);
      }
    } catch (SQLException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

        c = this.dataSource.getConnection();
        JDBCPersistenceHelper.connection.set(c);
      }
      return c;
    } catch (SQLException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

  private JDBCWithJNDIPersistenceHelper() {
    super();
    try {
      InputStream inputStream = ClassLoaderUtils.getResourceAsStream(JDBCWithJNDIPersistenceHelper.PROPERTIES_FILE);
      if (inputStream == null) {
        throw new PersistenceException("File " + JDBCWithJNDIPersistenceHelper.PROPERTIES_FILE + " not found in classpath");
      }

      Properties properties = PropertiesReader.getPlainTextInstance().getProperties(inputStream);
      String dataSource = properties.getProperty(JDBCWithJNDIPersistenceHelper.PROPERTY_DATASOURCE);
      Context context = new InitialContext();
      this.dataSource = (DataSource) context.lookup(dataSource);
    } catch (Exception e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.domain.persistence.orm.PersistenceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.