Package org.apache.sqoop.common

Examples of org.apache.sqoop.common.SqoopException


      return rs.getLong(1) != 0;

    } catch (SQLException e) {
      logException(e, connectionId);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0032, e);
    } finally {
      closeResultSets(rs);
      closeStatements(stmt);
    }
  }
View Full Code Here


      enableConn.setBoolean(1, enabled);
      enableConn.setLong(2, connectionId);
      enableConn.executeUpdate();
    } catch (SQLException ex) {
      logException(ex, connectionId);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0042, ex);
    } finally {
      closeStatements(enableConn);
    }
  }
View Full Code Here

      dltConn = conn.prepareStatement(STMT_DELETE_CONNECTION);
      dltConn.setLong(1, id);
      dltConn.executeUpdate();
    } catch (SQLException ex) {
      logException(ex, id);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0022, ex);
    } finally {
      closeStatements(dltConn);
    }
  }
View Full Code Here

      dltConnInput = conn.prepareStatement(STMT_DELETE_CONNECTION_INPUT);
      dltConnInput.setLong(1, id);
      dltConnInput.executeUpdate();
    } catch (SQLException ex) {
      logException(ex, id);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0022, ex);
    } finally {
      closeStatements(dltConnInput);
    }
  }
View Full Code Here

      stmt.setLong(1, id);

      List<MConnection> connections = loadConnections(stmt, conn);

      if(connections.size() != 1) {
        throw new SqoopException(DerbyRepoError.DERBYREPO_0024, "Couldn't find"
          + " connection with id " + id);
      }

      // Return the first and only one connection object
      return connections.get(0);

    } catch (SQLException ex) {
      logException(ex, id);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0023, ex);
    } finally {
      closeStatements(stmt);
    }
  }
View Full Code Here

      return loadConnections(stmt, conn);

    } catch (SQLException ex) {
      logException(ex);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0023, ex);
    } finally {
      closeStatements(stmt);
    }
  }
View Full Code Here

      return loadConnections(stmt, conn);

    } catch (SQLException ex) {
      logException(ex, connectorID);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0023, ex);
    } finally {
      closeStatements(stmt);
    }
  }
View Full Code Here

      updateConnectorStatement.setString(2, mConnector.getClassName());
      updateConnectorStatement.setString(3, mConnector.getVersion());
      updateConnectorStatement.setLong(4, mConnector.getPersistenceId());

      if (updateConnectorStatement.executeUpdate() != 1) {
        throw new SqoopException(DerbyRepoError.DERBYREPO_0038);
      }
      deleteInput.setLong(1, mConnector.getPersistenceId());
      deleteForm.setLong(1, mConnector.getPersistenceId());
      deleteInput.executeUpdate();
      deleteForm.executeUpdate();

    } catch (SQLException e) {
      logException(e, mConnector);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0038, e);
    } finally {
      closeStatements(updateConnectorStatement, deleteForm, deleteInput);
    }
    insertFormsForConnector(mConnector, conn);
View Full Code Here

      deleteInput.executeUpdate();
      deleteForm.executeUpdate();

    } catch (SQLException e) {
      logException(e, mFramework);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0044, e);
    } finally {
      closeStatements(deleteForm, deleteInput);
    }
    createOrUpdateFrameworkVersion(conn, mFramework);
    insertFormsForFramework(mFramework, conn);
View Full Code Here

      stmt.setString(7, job.getLastUpdateUser());
      stmt.setTimestamp(8, new Timestamp(job.getLastUpdateDate().getTime()));

      result = stmt.executeUpdate();
      if (result != 1) {
        throw new SqoopException(DerbyRepoError.DERBYREPO_0012,
          Integer.toString(result));
      }

      ResultSet rsetJobId = stmt.getGeneratedKeys();

      if (!rsetJobId.next()) {
        throw new SqoopException(DerbyRepoError.DERBYREPO_0013);
      }

      long jobId = rsetJobId.getLong(1);

      createInputValues(STMT_INSERT_JOB_INPUT,
                        jobId,
                        job.getConnectorPart().getForms(),
                        conn);
      createInputValues(STMT_INSERT_JOB_INPUT,
                        jobId,
                        job.getFrameworkPart().getForms(),
                        conn);

      job.setPersistenceId(jobId);

    } catch (SQLException ex) {
      logException(ex, job);
      throw new SqoopException(DerbyRepoError.DERBYREPO_0026, ex);
    } finally {
      closeStatements(stmt);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.sqoop.common.SqoopException

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.