log to file and 16 kB packet size
This commit is contained in:
@@ -11,6 +11,7 @@ import org.apache.log4j.Layout;
|
|||||||
import org.apache.log4j.Level;
|
import org.apache.log4j.Level;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.log4j.PatternLayout;
|
import org.apache.log4j.PatternLayout;
|
||||||
|
import org.apache.log4j.RollingFileAppender;
|
||||||
|
|
||||||
import com.univocity.parsers.csv.CsvParser;
|
import com.univocity.parsers.csv.CsvParser;
|
||||||
import com.univocity.parsers.csv.CsvParserSettings;
|
import com.univocity.parsers.csv.CsvParserSettings;
|
||||||
@@ -21,7 +22,7 @@ public class ToolboxFileExporter {
|
|||||||
|
|
||||||
|
|
||||||
private List<String[]> rows;
|
private List<String[]> rows;
|
||||||
private String baseDir = "I:\\Toolbox\\Assets";
|
private String baseDir = "F:\\Toolbox\\Assets";
|
||||||
|
|
||||||
// Formatdatei generiert mit
|
// Formatdatei generiert mit
|
||||||
// bcp "SELECT OriginalImage FROM AssetImages WHERE AssetID=586" queryout Image.jpg -S MOVNCG -d Bayertoolbox_prod -T
|
// bcp "SELECT OriginalImage FROM AssetImages WHERE AssetID=586" queryout Image.jpg -S MOVNCG -d Bayertoolbox_prod -T
|
||||||
@@ -34,7 +35,7 @@ public class ToolboxFileExporter {
|
|||||||
|
|
||||||
private String command1 = "bcp \"SELECT OriginalImage FROM AssetImages WHERE AssetID=";
|
private String command1 = "bcp \"SELECT OriginalImage FROM AssetImages WHERE AssetID=";
|
||||||
private String command2 = "\" queryout \"";
|
private String command2 = "\" queryout \"";
|
||||||
private String command3 = "\" -S MOVNCG -d Bayertoolbox_prod -T -f bcp.fmt";
|
private String command3 = "\" -S MOVNCG -d Bayertoolbox_prod -T -f \"F:\\Toolbox\\bcp.fmt\" -a 16384";
|
||||||
|
|
||||||
private File workingDir = new File(baseDir);
|
private File workingDir = new File(baseDir);
|
||||||
|
|
||||||
@@ -74,17 +75,25 @@ public class ToolboxFileExporter {
|
|||||||
|
|
||||||
CsvParser parser = new CsvParser(settings);
|
CsvParser parser = new CsvParser(settings);
|
||||||
|
|
||||||
rows = parser.parseAll(new File("I:\\Toolbox\\AssetImages.csv"));
|
rows = parser.parseAll(new File("F:\\Toolbox\\AssetImages.csv"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
Layout layout = new PatternLayout("%p %m%n"); // "%d{ISO8601} - %p %m%n"
|
Layout layout = new PatternLayout("%p %m%n"); // "%d{ISO8601} - %p %m%n"
|
||||||
BasicConfigurator.configure(new ConsoleAppender(layout));
|
BasicConfigurator.configure(new ConsoleAppender(layout));
|
||||||
|
BasicConfigurator.configure(new RollingFileAppender(layout, "F:\\Toolbox\\download.log", true));
|
||||||
log.setLevel(Level.DEBUG);
|
log.setLevel(Level.DEBUG);
|
||||||
|
|
||||||
try {
|
long startTime = System.currentTimeMillis();
|
||||||
|
log.debug("Start: " + startTime);
|
||||||
|
|
||||||
new ToolboxFileExporter();
|
new ToolboxFileExporter();
|
||||||
|
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
log.debug("End: " + endTime);
|
||||||
|
log.debug("Duration: " + (endTime - startTime));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user