Package jp.co.ntt.oss

Examples of jp.co.ntt.oss.SyncDatabaseException


  public static final int MLOG_RECORD_NOT_FOUND = -1;

  public static String getTablePrint(final String schema, final String table)
      throws SyncDatabaseException {
    if (table == null) {
      throw new SyncDatabaseException("error.argument");
    }

    if (schema == null) {
      return table;
    }
View Full Code Here


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

    PreparedStatement pstmt = null;
    ResultSet rset = null;

    try {
      pstmt = conn.prepareStatement("SELECT * "
          + "FROM observer.v$subscription "
          + "WHERE nspname = ? AND relname = ?");
      pstmt.setString(1, schema);
      pstmt.setString(2, table);
      rset = pstmt.executeQuery();

      // not found
      if (!rset.next()) {
        throw new SyncDatabaseException("error.no_subscription",
            SyncDatabaseDAO.getTablePrint(schema, table));
      }

      return new Subscription(rset.getString(SUBSCRIPTION_NSPNAME), rset
          .getString(SUBSCRIPTION_RELNAME), rset
View Full Code Here

  private static final int SET_SUBSCRIPTION_LAST_TYPE = 3;

  public static void setSubscription(final Connection conn,
      final Subscription subs) throws SQLException, SyncDatabaseException {
    if (conn == null || subs == null) {
      throw new SyncDatabaseException("error.argument");
    }

    CallableStatement cstmt = null;

    try {
View Full Code Here

  private static final int SUBSCRIBER_LASTCOUNT = 12;

  public static Subscriber getSubscriber(final Connection conn,
      final long subsID) throws SQLException, SyncDatabaseException {
    if (conn == null) {
      throw new SyncDatabaseException("error.argument");
    }

    PreparedStatement pstmt = null;
    ResultSet rset = null;

    try {
      pstmt = conn.prepareStatement("SELECT * FROM mlog.v$subscriber "
          + "WHERE subsid = ?");
      pstmt.setLong(1, subsID);
      rset = pstmt.executeQuery();

      // not found
      if (!rset.next()) {
        throw new SyncDatabaseException("error.no_subscriber", subsID);
      }

      return new Subscriber(rset.getLong(SUBSCRIBER_SUBSID), rset
          .getString(SUBSCRIBER_NSPNAME), rset
          .getString(SUBSCRIBER_RELNAME), rset
View Full Code Here

  private static final int SET_SUBSCRIBER_LAST_COUNT = 4;

  public static void setSubscriber(final Connection conn,
      final Subscriber suber) throws SQLException, SyncDatabaseException {
    if (conn == null || suber == null) {
      throw new SyncDatabaseException("error.argument");
    }

    CallableStatement cstmt = null;

    try {
View Full Code Here

  public static ArrayList<MasterStatus> getMasterStatus(
      final Connection conn, final String schema, final String table)
      throws SQLException, SyncDatabaseException {
    if (conn == null) {
      throw new SyncDatabaseException("error.argument");
    }

    PreparedStatement pstmt = null;
    ResultSet rset = null;
View Full Code Here

  }

  protected static long getLogCount(final Connection conn,
      final String mlogName) throws SyncDatabaseException, SQLException {
    if (conn == null) {
      throw new SyncDatabaseException("error.argument");
    }

    if (mlogName == null) {
      return MasterStatus.INVALID_LOG_COUNT;
    }
View Full Code Here

  public static ArrayList<ReplicaStatus> getReplicaStatus(
      final Connection conn, final String schema, final String table)
      throws SQLException, SyncDatabaseException {
    if (conn == null) {
      throw new SyncDatabaseException("error.argument");
    }

    PreparedStatement pstmt = null;
    ResultSet rset = null;
View Full Code Here

  }

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

    Statement stmt = null;
    ResultSet rset = null;
View Full Code Here

  public static Hashtable<Short, String> getPKNames(final Connection conn,
      final String schema, final String table) throws SQLException,
      SyncDatabaseException {
    if (conn == null || schema == null || table == null) {
      throw new SyncDatabaseException("error.argument");
    }

    // get replica table primary key definition
    final DatabaseMetaData dmd = conn.getMetaData();
    ResultSet rset = null;
View Full Code Here

TOP

Related Classes of jp.co.ntt.oss.SyncDatabaseException

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.