/// <exception cref="Java.Sql.SQLException"/> public DBRecordWriter(DBOutputFormat <K, V> _enclosing, Connection connection, PreparedStatement statement) { this._enclosing = _enclosing; this.connection = connection; this.statement = statement; this.connection.SetAutoCommit(false); }
/// <exception cref="System.IO.IOException"/> public virtual void TestSetOutput() { Job job = Job.GetInstance(new Configuration()); DBOutputFormat.SetOutput(job, "hadoop_output", fieldNames); DBConfiguration dbConf = new DBConfiguration(job.GetConfiguration()); string actual = format.ConstructQuery(dbConf.GetOutputTableName(), dbConf.GetOutputFieldNames ()); NUnit.Framework.Assert.AreEqual(expected, actual); job = Job.GetInstance(new Configuration()); dbConf = new DBConfiguration(job.GetConfiguration()); DBOutputFormat.SetOutput(job, "hadoop_output", nullFieldNames.Length); NUnit.Framework.Assert.IsNull(dbConf.GetOutputFieldNames()); NUnit.Framework.Assert.AreEqual(nullFieldNames.Length, dbConf.GetOutputFieldCount ()); actual = format.ConstructQuery(dbConf.GetOutputTableName(), new string[dbConf.GetOutputFieldCount ()]); NUnit.Framework.Assert.AreEqual(nullExpected, actual); }
/// <exception cref="Java.Sql.SQLException"/> public DBRecordWriter(DBOutputFormat <K, V> _enclosing) { this._enclosing = _enclosing; }