Search in sources :

Example 11 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryColumnsExist method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "tablename", tablename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "schemaname", schemaname);
        rep.saveDatabaseMetaJobEntryAttribute(id_job, getObjectId(), "connection", "id_database", connection);
        // save the arguments...
        if (arguments != null) {
            for (int i = 0; i < arguments.length; i++) {
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "name", arguments[i]);
            }
        }
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobEntryColumnsExist.Meta.UnableSaveRep", "" + id_job), dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 12 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryConnectedToRepository method saveRep.

// Save the attributes of this job entry
// 
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "isspecificrep", isspecificrep);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "repname", repname);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "isspecificuser", isspecificuser);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "username", username);
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobEntryConnectedToRepository.Meta.UnableToSaveToRep") + id_job, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 13 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryCopyFiles method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "copy_empty_folders", copy_empty_folders);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "arg_from_previous", arg_from_previous);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "overwrite_files", overwrite_files);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "include_subfolders", include_subfolders);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "remove_source_files", remove_source_files);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_result_filesname", add_result_filesname);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "destination_is_a_file", destination_is_a_file);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "create_destination_folder", create_destination_folder);
        // save the arguments...
        if (source_filefolder != null) {
            for (int i = 0; i < source_filefolder.length; i++) {
                saveSourceRep(rep, id_job, getObjectId(), i, source_filefolder[i]);
                saveDestinationRep(rep, id_job, getObjectId(), i, destination_filefolder[i]);
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "wildcard", wildcard[i]);
            }
        }
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobCopyFiles.Error.Exception.UnableSaveRep") + id_job, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 14 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryCopyMoveResultFilenames method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "foldername", foldername);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "specify_wildcard", specifywildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcard", wildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcardexclude", wildcardexclude);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "destination_folder", destination_folder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "nr_errors_less_than", nr_errors_less_than);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "success_condition", success_condition);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_date", add_date);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_time", add_time);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "SpecifyFormat", SpecifyFormat);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "date_time_format", date_time_format);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "AddDateBeforeExtension", AddDateBeforeExtension);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "action", action);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "OverwriteFile", OverwriteFile);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "CreateDestinationFolder", CreateDestinationFolder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "RemovedSourceFilename", RemovedSourceFilename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "AddDestinationFilename", AddDestinationFilename);
    } catch (KettleDatabaseException dbe) {
        throw new KettleXMLException(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.CanNotSaveToRep", "" + id_job, dbe.getMessage()));
    }
}
Also used : KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException)

Example 15 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryCreateFile method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "filename", filename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "fail_if_file_exists", failIfFileExists);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_filename_result", addfilenameresult);
    } catch (KettleDatabaseException dbe) {
        throw new KettleException("Unable to save job entry of type 'create file' to the repository for id_job=" + id_job, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Aggregations

KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)279 KettleException (org.pentaho.di.core.exception.KettleException)176 SQLException (java.sql.SQLException)69 Database (org.pentaho.di.core.database.Database)46 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)41 KettleValueException (org.pentaho.di.core.exception.KettleValueException)39 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)37 KettleDatabaseBatchException (org.pentaho.di.core.exception.KettleDatabaseBatchException)33 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)31 BatchUpdateException (java.sql.BatchUpdateException)27 ResultSet (java.sql.ResultSet)27 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)26 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)25 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)24 RowMeta (org.pentaho.di.core.row.RowMeta)22 FileObject (org.apache.commons.vfs2.FileObject)18 LongObjectId (org.pentaho.di.repository.LongObjectId)17 Savepoint (java.sql.Savepoint)16 ArrayList (java.util.ArrayList)16 Test (org.junit.Test)14