Examples of SyncDatabaseException


Examples of jp.co.ntt.oss.SyncDatabaseException

  public static void unSubscribeObserver(final Connection conn,
      final String schema, final String table)
      throws SyncDatabaseException, SQLException {
    if (conn == null || schema == null || table == null) {
      throw new SyncDatabaseException("error.argument");
    }

    CallableStatement cstmt = null;

    try {
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public static String getDescription(final Connection conn,
      final String resource) throws SQLException, SyncDatabaseException {
    if (conn == null) {
      throw new SyncDatabaseException("error.argument");
    }

    StringBuilder desc = new StringBuilder();
    DatabaseMetaData dmd = conn.getMetaData();
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public static Connection lockTable(final String name,
      final String quotedTable) throws Exception {
    if (name == null || quotedTable == null) {
      throw new SyncDatabaseException("error.argument");
    }

    Connection conn = null;
    Statement stmt = null;
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public static JdbcResource getJdbcResource(final String fileName,
      final String name) throws SyncDatabaseException, IOException {
    if (fileName == null || name == null) {
      throw new SyncDatabaseException("error.argument");
    }

    final Digester digester = new Digester();

    digester.addObjectCreate("SyncDatabase", JdbcResources.class);
    digester.addObjectCreate("SyncDatabase/jdbcResource",
        JdbcResource.class);
    digester.addSetNext("SyncDatabase/jdbcResource", "addJdbcResources");

    digester.addBeanPropertySetter("SyncDatabase/jdbcResource/name");
    digester.addBeanPropertySetter("SyncDatabase/jdbcResource/className");
    digester.addBeanPropertySetter("SyncDatabase/jdbcResource/url");
    digester.addBeanPropertySetter("SyncDatabase/jdbcResource/username");
    digester.addBeanPropertySetter("SyncDatabase/jdbcResource/password");

    final InputStream is = JdbcResource.class.getClassLoader()
        .getResourceAsStream(fileName);
    if (is == null) {
      throw new SyncDatabaseException("error.resourcefile_notfound",
          fileName);
    }

    JdbcResources resources = null;
    try {
      resources = (JdbcResources) digester.parse(is);
    } catch (final Exception e) {
      throw new SyncDatabaseException("error.resourcefile_parse", e
          .getMessage());
    } finally {
      is.close();
    }

    if (resources == null) {
      throw new SyncDatabaseException("error.resource_notfound", name);
    }

    for (final JdbcResource resource : resources.getJdbcResources()) {
      if (resource.getName().equals(name)) {
        return resource;
      }
    }

    throw new SyncDatabaseException("error.resource_notfound", name);
  }
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

   * Constructor for DatabaseResource.
   */
  public DatabaseResource(final String name) throws SyncDatabaseException,
      IOException, NamingException, SQLException {
    if (name == null) {
      throw new SyncDatabaseException("error.argument");
    }

    final JdbcResource jdbcResource = JdbcResource.getJdbcResource(
        RESOURCE_FILE_NAME, name);
    if (jdbcResource == null) {
      throw new SyncDatabaseException("error.resource_notfound", name);
    }

    log.debug(jdbcResource.getName() + " configuration:"
        + jdbcResource.getUsername() + "/" + jdbcResource.getUrl()
        + "/" + jdbcResource.getClassName());

    /*
     * Get a transaction manager. creates an instance of JOTM with a local
     * transaction factory. which is not bound to a registry.
     */
    try {
      jotm = new Jotm(true, false);

      xads = new StandardXADataSource();
      ((StandardXADataSource) xads).setDriverName(jdbcResource
          .getClassName());
      ((StandardXADataSource) xads).setUrl(jdbcResource.getUrl());
      ((StandardXADataSource) xads).setTransactionManager(jotm
          .getTransactionManager());

      xaconn = xads.getXAConnection(jdbcResource.getUsername(),
          jdbcResource.getPassword());
    } catch (final Exception e) {
      if (jotm != null) {
        jotm.stop();
      }

      throw new SyncDatabaseException("error.message", e.getMessage());
    }
  }
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  private int[] columnTypes = null;
  private String[] columnTypeNames = null;

  public MappingData(final int setColumnCount) throws SyncDatabaseException {
    if (setColumnCount < 1) {
      throw new SyncDatabaseException("error.argument");
    }

    this.columnCount = setColumnCount;
    dms = new DataMapper[setColumnCount];
    columnTypes = new int[setColumnCount];
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public final DataMapper getDataMapper(final int index)
      throws SyncDatabaseException {
    if (index < 0 || index >= this.columnCount) {
      throw new SyncDatabaseException("error.argument");
    }

    return dms[index];
  }
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public final void setDataMapper(final int index, final DataMapper dataMapper)
      throws SyncDatabaseException {
    if (index < 0 || index >= this.columnCount || dataMapper == null) {
      throw new SyncDatabaseException("error.argument");
    }

    this.dms[index] = dataMapper;
  }
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public final int getColumnType(final int index)
      throws SyncDatabaseException {
    if (index < 0 || index >= this.columnCount) {
      throw new SyncDatabaseException("error.argument");
    }

    return columnTypes[index];
  }
View Full Code Here

Examples of jp.co.ntt.oss.SyncDatabaseException

  }

  public final void setColumnType(final int index, final int columnType)
      throws SyncDatabaseException {
    if (index < 0 || index >= this.columnCount) {
      throw new SyncDatabaseException("error.argument");
    }

    this.columnTypes[index] = columnType;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.