日期:2014-05-18  浏览次数:20708 次

大家帮看看吧,
还是昨天的那个程序,不多说。直接上代码 

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class Mydate {
static Logger logger = Logger.getLogger("");
private Statement stm;
private Statement stm1;
private Connection con = null;
private ResultSet rs;
private String source_path;
private String DBDriver;
private String dbURL;
private String username;
private String password;
private PrintWriter pw;
private String path;
private FtpOperation ftp = null;
private String ziduan;
private List<String> list;
private List<String> list1;
private int number;

public Mydate() {
PropertyConfigurator.configure("./properties/log.properties");
logger.info("---------");
try {
source_path = JkConfig.getSource_path();
DBDriver = JkConfig.getDrivers();
dbURL = JkConfig.getUrl();
username = JkConfig.getUsername();
password = JkConfig.getPassword();
FtpOperation.ip = JkConfig.getFtp_ip();
FtpOperation.port = JkConfig.getFtp_port();
FtpOperation.username = JkConfig.getFtp_username();
FtpOperation.password = JkConfig.getFtp_password();
FtpOperation.path = JkConfig.getFtpfile();
path = JkConfig.getPath();
ziduan = JkConfig.getZiduan();
number = JkConfig.getNumber();
run();
} catch (IOException e) {
e.printStackTrace();
}
logger.info("----------");
}

private void run() {

try {
String[] tool = null;
String ziduan1 = "";
FileInputStream inputStream = new FileInputStream(
"./properties/ceshi_1.properties");
Properties pr = new Properties();
pr.load(inputStream);
Driver driver = (java.sql.Driver) Class.forName(DBDriver)
.newInstance();
DriverManager.registerDriver(driver);
Connection con = DriverManager.getConnection(dbURL, username,
password);
stm = con.createStatement();
System.out.println(number);
list = new ArrayList<String>();
list1 = new ArrayList<String>();
for (int j = 1; j <= numbe