Search in sources :

Example 36 with KettleDatabaseException

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

the class JobEntryEvalFilesMetrics method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        // save the arguments...
        if (sourceFileFolder != null) {
            for (int i = 0; i < sourceFileFolder.length; i++) {
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "source_filefolder", sourceFileFolder[i]);
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "wildcard", sourceWildcard[i]);
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "include_subFolders", sourceIncludeSubfolders[i]);
            }
        }
        rep.saveJobEntryAttribute(id_job, getObjectId(), "result_filenames_wildcard", resultFilenamesWildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "result_field_file", ResultFieldFile);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "result_field_wild", ResultFieldWildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "result_field_includesubfolders", ResultFieldIncludesubFolders);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "comparevalue", comparevalue);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "minvalue", minvalue);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "maxvalue", maxvalue);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "successnumbercondition", JobEntrySimpleEval.getSuccessNumberConditionCode(successConditionType));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "scale", getScaleCode(scale));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "source_files", getSourceFilesCode(sourceFiles));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "evaluation_type", getEvaluationTypeCode(evaluationType));
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobEvalFilesMetrics.Error.Exception.UnableSaveRep") + id_job, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 37 with KettleDatabaseException

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

the class JobEntryEvalTableContent method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveDatabaseMetaJobEntryAttribute(id_job, getObjectId(), "connection", "id_database", connection);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "schemaname", schemaname);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "tablename", tablename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "success_condition", getSuccessConditionCode(successCondition));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "limit", limit);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "custom_sql", customSQL);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "is_custom_sql", useCustomSQL);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "is_usevars", useVars);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_rows_result", addRowsResult);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "clear_result_rows", clearResultList);
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobEntryEvalTableContent.UnableSaveRep", "" + id_job), dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 38 with KettleDatabaseException

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

the class JobEntryExportRepository method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "repositoryname", repositoryname);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "username", username);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "password", Encr.encryptPasswordIfNotUsingVariables(password));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "targetfilename", targetfilename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "iffileexists", iffileexists);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "export_type", export_type);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "directoryPath", directoryPath);
        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(), "createfolder", createfolder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "newfolder", newfolder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "add_result_filesname", add_result_filesname);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "nr_errors_less_than", nr_errors_less_than);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "success_condition", success_condition);
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobExportRepository.Meta.UnableSaveRep", "" + id_job), dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 39 with KettleDatabaseException

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

the class JobEntryFolderIsEmpty 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(), "include_subfolders", includeSubfolders);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "specify_wildcard", specifywildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcard", wildcard);
    } catch (KettleDatabaseException dbe) {
        throw new KettleException("Unable to save job entry of type 'create Folder' 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)

Example 40 with KettleDatabaseException

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

the class JobEntryFTPSGet method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "port", port);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "servername", serverName);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "username", userName);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "password", Encr.encryptPasswordIfNotUsingVariables(password));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "FTPSdirectory", FTPSDirectory);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "targetdirectory", targetDirectory);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcard", wildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "binary", binaryMode);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "timeout", timeout);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "remove", remove);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "only_new", onlyGettingNewFiles);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "active", activeConnection);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "movefiles", movefiles);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "movetodirectory", movetodirectory);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "addtime", addtime);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "adddate", adddate);
        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(), "isaddresult", isaddresult);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "createmovefolder", createmovefolder);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_host", proxyHost);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_port", proxyPort);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_username", proxyUsername);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_password", Encr.encryptPasswordIfNotUsingVariables(proxyPassword));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "ifFileExists", getFileExistsAction(ifFileExists));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "nr_limit", nr_limit);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "success_condition", success_condition);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "connection_type", FTPSConnection.getConnectionType(connectionType));
    } catch (KettleDatabaseException dbe) {
        throw new KettleException("Unable to save job entry of type 'FTPS' 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