今天复习了一下Java的基础知识,做了一个读取数据入库的程序。由于读取的数据每天都更新,于是就想把程序做成一个服务,每天定时执行。研究了一下,发现有几种方式可以做。下面我主要记录一下JAVA Service Wrapper方式。除此之外,我会把一些基本内容也贴上,以后复习所用。
一、下面是整个程序的功能部分:
1.连接数据库的功能。我写了一个DBConnecter类,是一个单例。
public class DBConnecter {
private static DBConnecter instance = null;
private static Connection conn = null;
private DBConnecter() {
}
public synchronized static DBConnecter getInstance() {
if (instance == null) {
instance = new DBConnecter();
}
return instance;
}
//连接数据库
public Connection getConnection(String driver, String url) {
try {
Class.forName(driver);
conn = DriverManager.getConnection(url);
} catch (Exception e) {
System.out.println(e.getMessage());
}
return conn;
}
//Close关闭数据库连接
public void Close() {
try {
conn.close();
} catch (Exception e) {
}
}
}
public class DataWriter {
public void writeData(DBConnecter dbcon, List
public final class ConfigerReader {
private static ConfigerReader instance = null;
private static Map configerMap = null;
private ConfigerReader() {
}
public synchronized static ConfigerReader getInstance() {
if (instance == null) {
instance = new ConfigerReader();
}
return instance;
}
public Map getConfigerReader(String configerPath) {
if (configerMap != null) {
return configerMap;
}
InputStream inputStream = null;
Properties p = new Properties();
configerMap = new HashMap();
try {
inputStream = new FileInputStream(configerPath);
p.load(inputStream);
configerMap = new HashMap();
configerMap.put(Parameter.WFID, p.getProperty(Parameter.WFID));
configerMap.put(Parameter.STATIONID, p.getProperty(Parameter.STATIONID));
configerMap.put(Parameter.WFNAME, p.getProperty(Parameter.WFNAME));
configerMap.put(Parameter.WFTIME1, p.getProperty(Parameter.WFTIME1));
configerMap.put(Parameter.WFTIME2, p.getProperty(Parameter.WFTIME2));
configerMap.put(Parameter.DRIVER, p.getProperty(Parameter.DRIVER));
configerMap.put(Parameter.URL, p.getProperty(Parameter.URL));
configerMap.put(Parameter.USER, p.getProperty(Parameter.USER));
configerMap.put(Parameter.PWD, p.getProperty(Parameter.PWD));
configerMap.put(Parameter.DB, p.getProperty(Parameter.DB));
configerMap.put(Parameter.LOCALDIR, p.getProperty(Parameter.LOCALDIR));
configerMap.put(Parameter.BACKDIR, p.getProperty(Parameter.BACKDIR));
} catch (IOException ex) {
Logger.getLogger(ConfigerReader.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
inputStream.close();
} catch (IOException ex) {
Logger.getLogger(ConfigerReader.class.getName()).log(Level.SEVERE, null, ex);
}
}
return configerMap;
}
}
public class DataReader {
/**
* 以行为单位读取文件,常用于读面向行的格式化文件
*/
public List
这里读取文件的格式比较复杂,是wpd格式的。格式如下
054# station
时间(UTC+8) 风速 风向 温度 压力 湿度 垂直风
2013-04-05 00:00:00 5.45 215.03 1.65 83562.00 98.36 -0.02
2013-04-05 00:15:00 5.68 223.88 1.90 83575.00 97.36 -0.02
2013-04-05 00:30:00 6.62 230.38 1.99 83606.00 97.36 -0.01
2013-04-05 00:45:00 7.11 230.16 1.86 83549.00 98.19 -0.01
2013-04-05 01:00:00 7.36 235.47 1.67 83542.00 96.89 0.00
2013-04-05 01:15:00 7.23 246.65 1.26 83500.00 95.36 0.01
2013-04-05 01:30:00 7.30 261.32 0.96 83575.00 95.66 0.01
2013-04-05 01:45:00 7.46 271.98 0.93 83507.00 93.08 0.00
2013-04-05 02:00:00 7.66 276.50 1.10 83581.00 89.37 0.00
2013-04-05 02:15:00 7.78 280.41 1.15 83595.00 83.48 0.00
2013-04-05 02:30:00 8.06 285.14 1.14 83617.00 75.95 0.01
2013-04-05 02:45:00 8.62 289.21 1.14 83645.00 66.11 0.00
2013-04-05 03:00:00 8.63 294.42 1.19 83628.00 55.81 0.00
2013-04-05 03:15:00 8.82 297.83 1.20 83631.00 48.29 -0.01
2013-04-05 03:30:00 9.05 301.11 1.12 83613.00 43.46 -0.01
2013-04-05 03:45:00 9.15 304.14 0.86 83620.00 42.17 -0.01
2013-04-05 04:00:00 9.26 308.72 0.49 83603.00 45.34 -0.01
2013-04-05 04:15:00 9.51 315.30 -0.07 83596.00 50.88 0.00
2013-04-05 04:30:00 9.65 325.51 -0.85 83596.00 60.98 0.00
2013-04-05 04:45:00 9.70 333.05 -1.86 83633.00 74.52 -0.01
2013-04-05 05:00:00 10.18 336.66 -2.96 83629.00 86.34 -0.01
2013-04-05 05:15:00 10.46 338.63 -3.89 83735.00 95.00 -0.03
2013-04-05 05:30:00 9.51 340.02 -4.36 83439.00 96.36 -0.04
2013-04-05 05:45:00 8.36 339.08 -4.56 83600.00 95.36 -0.03
2013-04-05 06:00:00 8.23 336.10 -4.47 83760.00 95.00 -0.03
2013-04-05 06:15:00 8.74 332.44 -4.32 83738.00 93.36 -0.03
2013-04-05 06:30:00 9.30 329.47 -4.02 83700.00 87.00 -0.03
2013-04-05 06:45:00 9.45 328.75 -3.81 83680.00 82.34 -0.03
2013-04-05 07:00:00 8.57 329.40 -3.89 83747.00 82.70 -0.03
2013-04-05 07:15:00 8.39 328.51 -3.72 83762.00 82.54 -0.03
2013-04-05 07:30:00 8.80 328.57 -3.63 83804.00 80.54 -0.02
2013-04-05 07:45:00 9.50 329.67 -3.63 83800.00 80.00 -0.02
2013-04-05 08:00:00 9.88 332.62 -3.78 83807.00 80.00 -0.02
2013-04-05 08:15:00 10.19 335.14 -3.97 83854.00 80.00 -0.02
2013-04-05 08:30:00 10.63 338.06 -4.25 83879.00 79.00 -0.02
2013-04-05 08:45:00 11.25 340.32 -4.60 83893.00 78.00 -0.02
2013-04-05 09:00:00 11.67 342.55 -4.82 83951.00 76.36 -0.02
2013-04-05 09:15:00 11.61 343.81 -4.86 84008.00 73.36 -0.02
2013-04-05 09:30:00 11.73 344.94 -4.70 84022.00 69.36 -0.02
2013-04-05 09:45:00 12.00 345.77 -4.50 84028.00 65.36 -0.02
2013-04-05 10:00:00 12.34 346.91 -4.37 84036.00 63.30 -0.02
2013-04-05 10:15:00 12.59 347.66 -4.35 84028.00 61.36 -0.02
2013-04-05 10:30:00 12.82 348.99 -4.27 84025.00 59.46 -0.02
2013-04-05 10:45:00 12.83 349.65 -4.33 84018.00 59.00 -0.02
2013-04-05 11:00:00 12.83 349.65 -4.41 84022.00 59.00 -0.02
2013-04-05 11:15:00 12.83 349.65 -4.43 84031.00 58.36 -0.02
2013-04-05 11:30:00 12.74 349.99 -4.42 84045.00 57.36 -0.02
2013-04-05 11:45:00 12.72 350.55 -4.24 84087.00 55.46 -0.02
2013-04-05 12:00:00 12.62 350.59 -4.16 84084.00 55.00 -0.02
2013-04-05 12:15:00 12.49 350.64 -4.14 84130.00 54.83 -0.02
2013-04-05 12:30:00 12.30 350.63 -4.09 84146.00 53.89 -0.02
2013-04-05 12:45:00 12.14 350.67 -4.06 84152.00 52.30 -0.02
2013-04-05 13:00:00 12.09 351.10 -3.98 84196.00 51.30 -0.01
2013-04-05 13:15:00 12.15 351.10 -4.04 84143.00 51.83 -0.01
2013-04-05 13:30:00 12.28 351.15 -4.08 84148.00 52.83 -0.01
2013-04-05 13:45:00 12.43 351.15 -4.24 84143.00 53.83 -0.01
2013-04-05 14:00:00 12.53 351.19 -4.36 84151.00 54.83 -0.01
2013-04-05 14:15:00 12.57 352.01 -4.46 84152.00 55.00 -0.01
2013-04-05 14:30:00 12.58 352.10 -4.50 84158.00 55.30 -0.01
2013-04-05 14:45:00 12.53 352.14 -4.56 84152.00 55.30 -0.01
2013-04-05 15:00:00 12.52 352.14 -4.60 84158.00 54.36 -0.01
2013-04-05 15:15:00 12.53 352.14 -4.67 84150.00 54.36 -0.01
2013-04-05 15:30:00 12.59 352.15 -4.81 84156.00 55.00 -0.01
2013-04-05 15:45:00 12.69 352.15 -4.91 84156.00 54.30 -0.01
2013-04-05 16:00:00 12.79 352.15 -4.97 84150.00 53.36 -0.01
2013-04-05 16:15:00 12.91 352.66 -5.07 84233.00 52.36 -0.01
2013-04-05 16:30:00 13.16 353.06 -5.19 84244.00 51.46 -0.01
2013-04-05 16:45:00 13.13 353.71 -5.31 84257.00 51.36 -0.01
2013-04-05 17:00:00 13.13 353.71 -5.41 84305.00 50.30 -0.01
2013-04-05 17:15:00 13.10 353.72 -5.57 84298.00 50.30 -0.01
2013-04-05 17:30:00 13.05 354.63 -5.71 84340.00 50.36 -0.02
2013-04-05 17:45:00 12.96 354.98 -5.87 84342.00 50.46 -0.02
2013-04-05 18:00:00 12.78 354.99 -6.41 84348.00 51.36 -0.02
2013-04-05 18:15:00 12.69 354.99 -6.51 84349.00 51.46 -0.02
2013-04-05 18:30:00 12.68 354.60 -6.61 84348.00 51.46 -0.02
2013-04-05 18:45:00 12.72 354.02 -6.71 84358.00 51.46 -0.02
2013-04-05 19:00:00 12.74 353.60 -6.71 84362.00 51.36 -0.02
2013-04-05 19:15:00 12.74 352.65 -6.80 84406.00 50.36 -0.02
2013-04-05 19:30:00 12.74 351.69 -6.82 84443.00 49.36 -0.02
2013-04-05 19:45:00 12.76 350.70 -6.89 84442.00 48.36 -0.02
2013-04-05 20:00:00 12.76 349.74 -6.94 84422.00 48.30 -0.02
2013-04-05 20:15:00 12.59 349.46 -7.03 84418.00 47.36 -0.02
2013-04-05 20:30:00 12.64 348.67 -7.11 84368.00 47.30 -0.02
2013-04-05 20:45:00 12.66 348.57 -7.16 84407.00 46.36 -0.02
2013-04-05 21:00:00 12.53 347.99 -7.21 84379.00 46.36 -0.02
2013-04-05 21:15:00 12.31 347.09 -7.28 84345.00 46.36 -0.02
2013-04-05 21:30:00 11.98 346.97 -7.36 84308.00 47.00 -0.02
2013-04-05 21:45:00 11.54 346.17 -7.42 84393.00 48.00 -0.01
2013-04-05 22:00:00 11.18 346.07 -7.51 84388.00 49.00 -0.01
2013-04-05 22:15:00 10.93 345.60 -7.59 84301.00 49.46 -0.01
2013-04-05 22:30:00 10.77 344.79 -7.64 84356.00 49.46 -0.01
2013-04-05 22:45:00 10.74 344.12 -7.66 84237.00 49.46 -0.01
2013-04-05 23:00:00 10.71 344.12 -7.68 84318.00 48.46 -0.01
2013-04-05 23:15:00 11.03 344.46 -7.64 84313.00 46.93 0.00
2013-04-05 23:30:00 11.79 344.96 -7.58 84311.00 44.82 0.00
2013-04-05 23:45:00 11.91 345.05 -7.58 84287.00 44.36 0.00
2013-04-06 00:00:00 11.77 344.56 -7.65 84240.00 43.46 0.00
2013-04-06 00:15:00 11.68 343.64 -7.70 84271.00 43.46 0.00
2013-04-06 00:30:00 11.61 342.56 -7.79 84418.00 43.46 0.00
2013-04-06 00:45:00 11.58 340.69 -7.91 84246.00 43.36 0.00
2013-04-06 01:00:00 11.50 338.97 -8.06 84389.00 43.46 0.00
2013-04-06 01:15:00 11.44 337.60 -8.26 84253.00 43.46 -0.01
2013-04-06 01:30:00 11.37 336.96 -8.45 84303.00 44.36 -0.01
2013-04-06 01:45:00 11.37 337.04 -8.62 84335.00 44.46 -0.01
2013-04-06 02:00:00 11.43 337.52 -8.77 84337.00 45.00 -0.01
2013-04-06 02:15:00 11.38 338.92 -8.89 84341.00 45.36 -0.02
2013-04-06 02:30:00 11.19 340.30 -9.04 84300.00 46.00 -0.02
2013-04-06 02:45:00 10.76 341.56 -9.14 84252.00 46.36 -0.02
2013-04-06 03:00:00 10.33 342.33 -9.24 84245.00 47.00 -0.02
2013-04-06 03:15:00 9.95 342.44 -9.36 84240.00 48.36 -0.01
2013-04-06 03:30:00 9.74 343.05 -9.46 84238.00 50.00 -0.01
2013-04-06 03:45:00 9.57 344.11 -9.56 84238.00 51.00 -0.01
2013-04-06 04:00:00 9.33 346.09 -9.66 84229.00 52.36 -0.01
2013-04-06 04:15:00 9.14 347.90 -9.79 84215.00 53.36 -0.01
2013-04-06 04:30:00 9.04 348.86 -9.91 84241.00 54.36 -0.01
2013-04-06 04:45:00 8.97 349.06 -10.03 84245.00 55.36 -0.01
2013-04-06 05:00:00 8.89 349.00 -10.11 84250.00 56.36 -0.01
2013-04-06 05:15:00 8.68 349.05 -10.18 84243.00 57.00 -0.02
2013-04-06 05:30:00 8.40 349.51 -10.24 84239.00 57.46 -0.02
2013-04-06 05:45:00 8.08 349.61 -10.28 84236.00 58.00 -0.02
2013-04-06 06:00:00 7.76 350.70 -10.34 84219.00 59.00 -0.02
2013-04-06 06:15:00 7.31 351.70 -10.39 84180.00 59.00 -0.02
2013-04-06 06:30:00 6.97 353.23 -10.33 84184.00 56.36 -0.01
2013-04-06 06:45:00 6.72 354.15 -10.21 84209.00 54.36 -0.01
2013-04-06 07:00:00 6.93 355.56 -9.72 84237.00 52.36 -0.01
2013-04-06 07:15:00 7.08 356.15 -9.50 84246.00 51.36 -0.01
2013-04-06 07:30:00 7.26 355.87 -9.31 84249.00 49.46 -0.01
2013-04-06 07:45:00 7.41 355.93 -9.10 84252.00 48.46 -0.01
2013-04-06 08:00:00 7.59 355.89 -8.88 84255.00 47.46 -0.01
2013-04-06 08:15:00 7.69 355.93 -8.61 84250.00 45.46 -0.01
2013-04-06 08:30:00 7.63 355.39 -8.37 84243.00 44.00 -0.01
2013-04-06 08:45:00 7.47 354.16 -8.10 84256.00 42.46 -0.01
2013-04-06 09:00:00 7.37 351.38 -7.82 84253.00 40.46 -0.01
2013-04-06 09:15:00 7.30 347.83 -7.57 84295.00 39.00 -0.01
2013-04-06 09:30:00 7.21 344.73 -7.27 84295.00 38.00 -0.01
2013-04-06 09:45:00 7.24 341.54 -6.97 84295.00 37.00 -0.01
2013-04-06 10:00:00 7.25 338.96 -6.66 84251.00 35.00 -0.01
2013-04-06 10:15:00 7.44 336.57 -6.31 84248.00 33.00 -0.01
2013-04-06 10:30:00 7.57 335.14 -6.01 84202.00 32.00 -0.01
2013-04-06 10:45:00 7.69 334.40 -5.61 84201.00 30.00 -0.01
2013-04-06 11:00:00 7.76 332.44 -5.31 84148.00 29.00 -0.01
2013-04-06 11:15:00 7.88 330.88 -4.99 84137.00 28.00 -0.01
2013-04-06 11:30:00 7.97 328.19 -4.68 84139.00 28.00 -0.01
2013-04-06 11:45:00 7.94 326.25 -4.33 84117.00 27.00 -0.01
2013-04-06 12:00:00 7.90 325.15 -4.00 84108.00 26.89 -0.01
2013-04-06 12:15:00 7.92 324.14 -3.70 84107.00 26.00 -0.01
2013-04-06 12:30:00 7.98 323.23 -3.39 84107.00 25.00 -0.01
2013-04-06 12:45:00 8.08 322.70 -3.09 84054.00 24.00 -0.01
2013-04-06 13:00:00 8.24 321.80 -2.79 84052.00 23.00 -0.01
2013-04-06 13:15:00 8.47 320.80 -2.56 84002.00 23.00 -0.01
2013-04-06 13:30:00 8.68 319.79 -2.29 83955.00 22.00 -0.01
2013-04-06 13:45:00 8.87 319.22 -2.06 83946.00 22.00 -0.01
2013-04-06 14:00:00 8.96 318.82 -1.86 83911.00 21.59 -0.01
2013-04-06 14:15:00 8.97 318.28 -1.65 83902.00 21.54 -0.01
2013-04-06 14:30:00 9.01 318.30 -1.38 83909.00 21.00 -0.01
2013-04-06 14:45:00 9.01 318.84 -1.17 83858.00 21.00 -0.01
2013-04-06 15:00:00 9.06 319.31 -0.94 83862.00 21.00 -0.01
2013-04-06 15:15:00 9.08 320.22 -0.72 83808.00 21.00 -0.01
2013-04-06 15:30:00 9.12 320.25 -0.52 83807.00 21.00 -0.01
2013-04-06 15:45:00 9.22 320.25 -0.37 83806.00 22.00 -0.01
2013-04-06 16:00:00 9.18 320.29 -0.25 83800.00 22.00 -0.01
2013-04-06 16:15:00 9.11 321.05 -0.07 83806.00 22.00 -0.01
2013-04-06 16:30:00 9.01 321.30 -0.01 83810.00 22.83 -0.01
2013-04-06 16:45:00 8.81 321.30 0.05 83799.00 22.83 -0.01
2013-04-06 17:00:00 8.62 321.66 0.12 83805.00 23.00 -0.01
2013-04-06 17:15:00 8.32 321.80 0.12 83805.00 23.00 -0.01
2013-04-06 17:30:00 7.89 322.24 0.12 83753.00 23.00 -0.01
2013-04-06 17:45:00 7.28 322.76 0.06 83713.00 23.00 -0.01
2013-04-06 18:00:00 6.26 323.22 -0.23 83700.00 23.17 0.00
2013-04-06 18:15:00 5.68 322.96 -0.24 83691.00 24.00 0.00
2013-04-06 18:30:00 5.37 322.18 -0.26 83691.00 25.00 0.00
2013-04-06 18:45:00 5.05 320.78 -0.25 83686.00 25.00 0.00
2013-04-06 19:00:00 4.67 318.12 -0.19 83676.00 26.00 0.00
2013-04-06 19:15:00 4.42 314.90 -0.18 83670.00 26.00 0.00
2013-04-06 19:30:00 4.06 312.20 -0.21 83665.00 27.00 0.00
2013-04-06 19:45:00 3.86 310.53 -0.20 83641.00 27.00 0.00
2013-04-06 20:00:00 3.78 310.32 -0.22 83635.00 27.00 0.00
2013-04-06 20:15:00 3.70 310.66 -0.27 83628.00 27.00 -0.01
2013-04-06 20:30:00 3.53 311.58 -0.29 83631.00 27.70 -0.01
2013-04-06 20:45:00 3.29 311.97 -0.33 83628.00 28.00 -0.01
2013-04-06 21:00:00 3.14 312.43 -0.34 83626.00 28.54 -0.01
2013-04-06 21:15:00 2.95 314.55 -0.31 83638.00 28.94 -0.01
2013-04-06 21:30:00 2.59 318.68 -0.27 83627.00 28.94 -0.01
2013-04-06 21:45:00 2.30 320.08 -0.26 83600.00 29.54 -0.02
2013-04-06 22:00:00 2.04 318.58 -0.24 83578.00 29.54 -0.02
2013-04-06 22:15:00 1.76 307.90 -0.21 83555.00 30.00 -0.02
2013-04-06 22:30:00 1.60 288.66 -0.20 83486.00 30.00 -0.01
2013-04-06 22:45:00 1.86 259.64 -0.24 83425.00 30.83 0.00
2013-04-06 23:00:00 3.07 233.91 -0.41 83397.00 31.00 0.01
2013-04-06 23:15:00 4.95 221.53 -0.71 83352.00 32.00 0.00
2013-04-06 23:30:00 6.52 216.39 -1.00 83429.00 33.83 0.00
2013-04-06 23:45:00 7.16 214.62 -1.18 83475.00 34.00 -0.01
2013-04-07 00:00:00 7.02 214.96 -1.18 83455.00 34.00 -0.02
2013-04-07 00:15:00 6.74 217.38 -1.09 83446.00 34.00 -0.01
2013-04-07 00:30:00 6.73 220.36 -1.07 83445.00 34.11 -0.01
2013-04-07 00:45:00 6.78 225.92 -1.13 83402.00 34.64 -0.01
2013-04-07 01:00:00 6.88 233.23 -1.25 83314.00 34.11 -0.01
2013-04-07 01:15:00 7.00 238.48 -1.58 83110.00 33.00 -0.01
2013-04-07 01:30:00 7.28 242.26 -1.73 83131.00 33.00 0.00
2013-04-07 01:45:00 7.48 243.65 -1.72 83015.00 34.00 0.00
2013-04-07 02:00:00 7.71 244.40 -1.75 83076.00 34.17 0.00
2013-04-07 02:15:00 7.79 244.60 -1.75 83041.00 34.00 0.00
2013-04-07 02:30:00 7.92 244.22 -1.78 83240.00 34.06 0.00
2013-04-07 02:45:00 7.96 241.95 -1.92 82846.00 33.46 0.00
2013-04-07 03:00:00 8.04 238.85 -2.03 83063.00 34.17 0.00
2013-04-07 03:15:00 8.15 236.44 -2.08 83013.00 34.46 -0.01
2013-04-07 03:30:00 8.36 234.94 -2.30 83022.00 34.06 -0.01
2013-04-07 03:45:00 8.53 232.51 -2.45 83022.00 34.46 -0.01
2013-04-07 04:00:00 8.75 230.11 -2.50 83008.00 35.00 -0.02
2013-04-07 04:15:00 8.97 230.59 -2.54 83007.00 35.00 -0.02
2013-04-07 04:30:00 8.98 233.14 -2.51 82877.00 35.00 -0.02
2013-04-07 04:45:00 9.06 236.04 -2.48 82884.00 34.36 -0.02
2013-04-07 05:00:00 9.41 240.62 -2.47 82883.00 34.36 -0.02
2013-04-07 05:15:00 9.63 244.20 -2.56 82879.00 34.36 -0.02
2013-04-07 05:30:00 9.88 247.08 -2.61 82836.00 34.30 -0.02
2013-04-07 05:45:00 9.98 249.38 -2.66 82749.00 34.30 -0.02
2013-04-07 06:00:00 10.02 251.91 -2.64 82732.00 34.30 -0.02
2013-04-07 06:15:00 10.28 254.46 -2.53 82727.00 34.00 -0.02
2013-04-07 06:30:00 10.39 254.99 -2.41 82775.00 32.89 -0.02
2013-04-07 06:45:00 10.21 254.09 -2.31 83097.00 31.89 -0.02
2013-04-07 07:00:00 9.65 253.18 -2.40 83097.00 27.36 -0.02
2013-04-07 07:15:00 9.66 253.61 -2.32 83102.00 26.00 -0.02
2013-04-07 07:30:00 9.38 253.15 -1.92 83116.00 25.89 -0.02
2013-04-07 07:45:00 9.60 255.45 -1.41 83116.00 24.30 -0.01
2013-04-07 08:00:00 9.35 256.94 -0.99 83116.00 23.89 -0.01
2013-04-07 08:15:00 9.50 262.00 -0.48 83138.00 23.30 0.00
2013-04-07 08:30:00 9.64 266.55 -0.01 83162.00 22.30 0.01
2013-04-07 08:45:00 9.53 270.89 0.45 83167.00 21.89 0.01
2013-04-07 09:00:00 9.36 273.53 0.94 83189.00 21.89 0.01
2013-04-07 09:15:00 9.21 276.83 1.39 83188.00 21.00 0.01
2013-04-07 09:30:00 9.25 281.15 1.81 83181.00 21.54 0.01
2013-04-07 09:45:00 9.45 286.12 2.18 83230.00 23.00 0.01
2013-04-07 10:00:00 9.70 290.45 2.52 83221.00 25.00 0.01
2013-04-07 10:15:00 9.82 293.00 2.71 83169.00 27.00 0.01
2013-04-07 10:30:00 9.96 294.97 2.84 83165.00 28.00 0.00
2013-04-07 10:45:00 9.93 295.59 2.93 83149.00 29.00 0.00
2013-04-07 11:00:00 9.97 295.99 3.02 83147.00 29.54 0.00
2013-04-07 11:15:00 9.98 295.62 3.06 83148.00 29.54 0.00
2013-04-07 11:30:00 10.04 296.08 3.03 83147.00 30.00 0.00
2013-04-07 11:45:00 10.04 296.62 2.99 83147.00 30.94 0.00
2013-04-07 12:00:00 9.94 297.18 2.97 83190.00 31.54 -0.01
2013-04-07 12:15:00 9.83 297.58 2.97 83242.00 32.54 -0.01
2013-04-07 12:30:00 9.65 298.05 2.97 83254.00 33.00 -0.01
2013-04-07 12:45:00 9.56 298.55 3.03 83260.00 34.00 -0.01
2013-04-07 13:00:00 9.41 299.13 3.07 83172.00 34.54 -0.01
2013-04-07 13:15:00 9.40 300.13 3.01 83174.00 35.00 0.00
2013-04-07 13:30:00 9.43 301.01 2.94 83169.00 35.89 0.00
2013-04-07 13:45:00 9.33 301.28 2.94 83169.00 35.89 -0.01
2013-04-07 14:00:00 9.12 303.17 2.94 83169.00 35.30 0.00
2013-04-07 14:15:00 9.04 306.45 2.95 83171.00 34.89 0.00
2013-04-07 14:30:00 9.07 309.50 2.89 83167.00 33.89 0.00
2013-04-07 14:45:00 8.98 310.98 2.88 83161.00 33.89 0.00
2013-04-07 15:00:00 9.14 312.09 2.77 83162.00 33.89 0.00
2013-04-07 15:15:00 9.16 313.54 2.58 83164.00 33.89 0.00
2013-04-07 15:30:00 9.02 314.08 2.43 83175.00 33.89 0.00
2013-04-07 15:45:00 8.61 314.60 2.24 83179.00 33.30 -0.01
2013-04-07 16:00:00 8.25 315.74 2.13 83176.00 33.30 -0.01
2013-04-07 16:15:00 7.91 318.28 2.03 83188.00 33.30 -0.01
2013-04-07 16:30:00 7.71 320.81 1.93 83275.00 33.30 -0.01
2013-04-07 16:45:00 7.60 322.75 1.80 83286.00 33.30 -0.01
2013-04-07 17:00:00 7.47 324.32 1.69 83285.00 33.89 -0.01
2013-04-07 17:15:00 7.42 325.70 1.53 83280.00 33.89 -0.01
2013-04-07 17:30:00 7.46 326.73 1.33 83280.00 33.89 -0.01
2013-04-07 17:45:00 7.52 327.33 1.13 83280.00 34.89 -0.01
2013-04-07 18:00:00 7.63 328.20 0.71 83274.00 34.89 0.00
2013-04-07 18:15:00 7.84 330.24 0.48 83272.00 35.89 0.00
2013-04-07 18:30:00 8.06 333.16 0.22 83270.00 36.89 -0.01
2013-04-07 18:45:00 8.32 336.74 -0.08 83266.00 36.89 -0.01
2013-04-07 19:00:00 8.56 340.25 -0.38 83271.00 37.30 -0.01
2013-04-07 19:15:00 8.77 342.31 -0.58 83280.00 37.89 -0.01
2013-04-07 19:30:00 9.04 344.27 -0.89 83293.00 38.30 -0.01
2013-04-07 19:45:00 9.34 346.03 -1.18 83229.00 39.30 -0.01
2013-04-07 20:00:00 9.69 346.95 -1.53 83148.00 40.89 -0.01
2013-04-07 20:15:00 9.88 347.90 -1.89 83054.00 42.89 -0.01
2013-04-07 20:30:00 9.80 347.93 -2.28 82970.00 45.83 -0.01
2013-04-07 20:45:00 9.55 349.66 -2.58 82928.00 47.83 -0.01
2013-04-07 21:00:00 9.34 351.82 -2.87 82850.00 48.36 -0.01
2013-04-07 21:15:00 9.20 355.54 -3.12 82776.00 50.36 -0.01
2013-04-07 21:30:00 9.26 359.08 -3.46 82693.00 51.46 -0.01
2013-04-07 21:45:00 9.24 1.32 -3.75 82626.00 51.93 -0.01
2013-04-07 22:00:00 9.41 3.10 -3.99 82570.00 51.93 -0.01
2013-04-07 22:15:00 9.80 5.01 -4.21 82513.00 50.99 -0.01
2013-04-07 22:30:00 10.16 5.70 -4.56 82394.00 50.52 -0.01
2013-04-07 22:45:00 10.18 7.02 -4.99 82408.00 52.36 -0.01
2013-04-07 23:00:00 9.94 5.98 -5.47 82616.00 56.00 -0.01
2013-04-07 23:15:00 9.57 5.02 -6.20 82881.00 64.30 -0.02
2013-04-07 23:30:00 8.99 5.37 -6.77 83089.00 73.00 -0.02
2013-04-07 23:45:00 8.53 8.59 -7.09 83209.00 78.00 -0.02
080# station
时间(UTC+8) 风速 风向 温度 压力 湿度 垂直风
2013-04-05 00:00:00 6.58 217.43 2.19 84016.00 96.16 0.00
2013-04-05 00:15:00 6.79 225.32 2.46 84033.00 95.00 0.00
2013-04-05 00:30:00 7.55 231.58 2.66 84032.00 95.00 0.00
2013-04-05 00:45:00 8.06 232.24 2.51 84012.00 95.00 0.00
2013-04-05 01:00:00 8.37 238.10 2.36 84011.00 95.00 0.00
2013-04-05 01:15:00 8.53 251.25 1.94 84006.00 93.00 0.00
2013-04-05 01:30:00 8.75 264.59 1.57 84022.00 89.64 0.00
2013-04-05 01:45:00 8.55 272.44 1.52 84012.00 85.64 0.00
2013-04-05 02:00:00 8.35 276.47 1.67 84050.00 80.40 0.00
2013-04-05 02:15:00 8.25 280.49 1.66 84079.00 75.00 0.00
2013-04-05 02:30:00 8.37 285.53 1.66 84099.00 67.00 0.00
2013-04-05 02:45:00 8.79 289.17 1.58 84117.00 56.00 0.00
2013-04-05 03:00:00 8.70 293.58 1.62 84108.00 48.00 0.00
2013-04-05 03:15:00 8.75 295.54 1.61 84103.00 44.00 0.00
2013-04-05 03:30:00 8.82 298.46 1.45 84076.00 42.00 -0.01
2013-04-05 03:45:00 8.70 301.94 1.10 84090.00 43.00 -0.01
2013-04-05 04:00:00 8.73 309.36 0.69 84081.00 48.00 0.00
2013-04-05 04:15:00 8.91 319.30 -0.01 84057.00 56.00 0.00
2013-04-05 04:30:00 8.99 329.52 -0.91 84014.00 68.00 0.00
2013-04-05 04:45:00 9.20 333.71 -1.96 84163.00 81.60 0.00
2013-04-05 05:00:00 9.88 334.38 -3.06 84123.00 91.36 -0.01
2013-04-05 05:15:00 9.58 334.77 -3.85 84262.00 95.00 -0.01
2013-04-05 05:30:00 8.21 334.87 -4.19 83963.00 94.64 -0.01
2013-04-05 05:45:00 7.08 333.89 -4.29 84171.00 94.00 -0.01
2013-04-05 06:00:00 7.05 331.15 -4.27 84223.00 93.00 -0.01
2013-04-05 06:15:00 7.56 328.01 -4.17 84305.00 91.00 -0.01
2013-04-05 06:30:00 8.03 325.90 -3.89 84172.00 86.36 -0.01
2013-04-05 06:45:00 7.70 327.13 -3.98 84291.00 86.00 -0.01
2013-04-05 07:00:00 7.31 326.54 -3.74 84295.00 84.00 -0.01
2013-04-05 07:15:00 7.38 326.36 -3.54 84270.00 82.00 0.00
2013-04-05 07:30:00 7.98 327.11 -3.46 84356.00 80.00 0.00
2013-04-05 07:45:00 8.84 329.35 -3.49 84347.00 79.16 0.00
2013-04-05 08:00:00 9.33 332.36 -3.69 84351.00 79.64 0.00
2013-04-05 08:15:00 9.72 334.56 -3.91 84350.00 79.64 -0.01
2013-04-05 08:30:00 10.23 337.49 -4.25 84433.00 78.64 -0.01
2013-04-05 08:45:00 10.83 339.42 -4.58 84455.00 77.16 -0.01
2013-04-05 09:00:00 11.06 341.11 -4.73 84475.00 75.00 -0.01
2013-04-05 09:15:00 10.89 342.32 -4.65 84587.00 71.00 0.00
2013-04-05 09:30:00 11.07 343.89 -4.45 84589.00 67.00 0.00
2013-04-05 09:45:00 11.28 344.81 -4.24 84592.00 63.00 0.00
2013-04-05 10:00:00 11.57 345.75 -4.10 84581.00 61.40 0.00
2013-04-05 10:15:00 11.78 346.13 -4.09 84577.00 60.00 0.00
2013-04-05 10:30:00 12.06 347.97 -4.03 84568.00 58.64 0.00
2013-04-05 10:45:00 12.06 348.07 -4.12 84571.00 58.00 0.00
2013-04-05 11:00:00 12.06 348.12 -4.17 84583.00 58.00 0.00
2013-04-05 11:15:00 12.06 348.13 -4.17 84585.00 57.64 0.00
2013-04-05 11:30:00 11.98 349.01 -4.12 84603.00 56.00 0.00
2013-04-05 11:45:00 12.05 349.09 -3.97 84593.00 54.64 0.00
2013-04-05 12:00:00 11.97 349.05 -3.89 84587.00 54.00 0.00
2013-04-05 12:15:00 11.85 349.05 -3.86 84688.00 53.16 0.00
2013-04-05 12:30:00 11.75 349.05 -3.79 84683.00 52.64 0.00
2013-04-05 12:45:00 11.58 349.13 -3.72 84702.00 50.64 0.00
2013-04-05 13:00:00 11.65 349.99 -3.67 84692.00 49.64 0.00
2013-04-05 13:15:00 11.68 350.03 -3.74 84697.00 50.64 0.00
2013-04-05 13:30:00 11.85 350.03 -3.79 84684.00 51.64 0.00
2013-04-05 13:45:00 11.97 350.03 -3.94 84697.00 52.64 0.00
2013-04-05 14:00:00 12.06 350.05 -4.04 84696.00 53.64 0.00
2013-04-05 14:15:00 12.14 350.91 -4.14 84698.00 53.64 0.00
2013-04-05 14:30:00 12.17 350.98 -4.15 84696.00 53.40 0.00
2013-04-05 14:45:00 12.17 350.98 -4.23 84701.00 53.40 0.00
2013-04-05 15:00:00 12.17 350.98 -4.25 84696.00 52.64 0.00
2013-04-05 15:15:00 12.18 350.98 -4.35 84696.00 53.00 0.00
2013-04-05 15:30:00 12.20 350.94 -4.44 84698.00 53.00 0.00
2013-04-05 15:45:00 12.30 350.97 -4.55 84697.00 52.00 0.00
2013-04-05 16:00:00 12.40 350.97 -4.63 84702.00 51.00 0.00
2013-04-05 16:15:00 12.50 351.01 -4.73 84796.00 50.40 0.00
2013-04-05 16:30:00 12.69 351.90 -4.85 84794.00 50.00 0.00
2013-04-05 16:45:00 12.60 352.00 -4.95 84800.00 49.40 0.00
2013-04-05 17:00:00 12.59 352.00 -5.05 84801.00 48.64 0.00
2013-04-05 17:15:00 12.51 352.01 -5.22 84808.00 48.64 0.00
2013-04-05 17:30:00 12.40 352.99 -5.34 84896.00 49.00 0.00
2013-04-05 17:45:00 12.19 353.85 -5.52 84901.00 49.64 0.00
2013-04-05 18:00:00 11.91 353.85 -5.95 84898.00 50.00 -0.01
2013-04-05 18:15:00 11.81 353.86 -6.05 84911.00 50.00 -0.01
2013-04-05 18:30:00 11.80 353.00 -6.15 84898.00 50.00 -0.01
2013-04-05 18:45:00 11.86 352.94 -6.25 84911.00 50.00 -0.01
2013-04-05 19:00:00 11.89 352.00 -6.25 84917.00 49.40 -0.01
2013-04-05 19:15:00 11.88 351.00 -6.35 84911.00 48.40 -0.01
2013-04-05 19:30:00 11.88 350.06 -6.35 85008.00 47.40 -0.01
2013-04-05 19:45:00 11.90 349.06 -6.40 84999.00 46.40 -0.01
2013-04-05 20:00:00 11.89 348.07 -6.45 84974.00 46.40 -0.01
2013-04-05 20:15:00 11.57 347.98 -6.55 84988.00 46.00 -0.01
2013-04-05 20:30:00 11.56 347.03 -6.65 84928.00 45.40 -0.01
2013-04-05 20:45:00 11.62 346.96 -6.65 84981.00 45.00 -0.01
2013-04-05 21:00:00 11.53 346.89 -6.75 84924.00 45.00 -0.01
2013-04-05 21:15:00 11.35 345.95 -6.80 84893.00 45.64 -0.01
2013-04-05 21:30:00 11.07 345.81 -6.90 84857.00 46.00 -0.01
2013-04-05 21:45:00 10.63 344.86 -6.96 84924.00 47.00 0.00
2013-04-05 22:00:00 10.33 344.57 -7.06 84948.00 48.00 0.00
2013-04-05 22:15:00 10.04 343.92 -7.11 84854.00 48.00 -0.01
2013-04-05 22:30:00 9.94 342.96 -7.16 84971.00 48.00 -0.01
2013-04-05 22:45:00 9.93 342.86 -7.20 84785.00 48.00 0.00
2013-04-05 23:00:00 9.99 342.91 -7.20 84801.00 47.00 0.00
2013-04-05 23:15:00 10.77 343.81 -7.16 84766.00 45.00 0.00
2013-04-05 23:30:00 11.64 343.91 -7.06 84752.00 43.00 0.00
2013-04-05 23:45:00 11.61 343.81 -7.06 84747.00 42.00 0.00
2013-04-06 00:00:00 11.42 342.92 -7.16 84724.00 42.00 0.00
2013-04-06 00:15:00 11.35 341.89 -7.21 84714.00 42.00 0.00
2013-04-06 00:30:00 11.33 340.86 -7.27 84910.00 42.00 -0.01
2013-04-06 00:45:00 11.34 338.87 -7.41 84721.00 42.00 0.00
2013-04-06 01:00:00 11.21 337.21 -7.57 84830.00 42.00 0.00
2013-04-06 01:15:00 10.95 335.32 -7.76 84870.00 42.00 -0.01
2013-04-06 01:30:00 10.86 335.01 -7.96 84875.00 43.00 -0.01
2013-04-06 01:45:00 10.89 335.03 -8.11 84892.00 43.00 -0.01
2013-04-06 02:00:00 10.94 335.39 -8.31 84895.00 44.00 -0.01
2013-04-06 02:15:00 10.85 337.02 -8.41 84887.00 44.00 -0.01
2013-04-06 02:30:00 10.62 338.35 -8.56 84794.00 45.00 -0.01
2013-04-06 02:45:00 10.09 339.93 -8.66 84793.00 45.64 -0.01
2013-04-06 03:00:00 9.61 340.22 -8.76 84799.00 46.64 -0.01
2013-04-06 03:15:00 9.24 340.20 -8.91 84799.00 47.64 -0.01
2013-04-06 03:30:00 9.05 340.28 -9.01 84793.00 49.00 -0.01
2013-04-06 03:45:00 8.91 341.36 -9.11 84790.00 50.00 -0.01
2013-04-06 04:00:00 8.65 343.33 -9.21 84798.00 51.00 -0.01
2013-04-06 04:15:00 8.51 345.00 -9.31 84795.00 52.00 -0.01
2013-04-06 04:30:00 8.42 345.93 -9.41 84797.00 53.00 -0.01
2013-04-06 04:45:00 8.33 346.22 -9.55 84796.00 54.00 -0.01
2013-04-06 05:00:00 8.10 345.98 -9.60 84793.00 55.00 -0.01
2013-04-06 05:15:00 7.84 345.97 -9.65 84802.00 56.00 -0.01
2013-04-06 05:30:00 7.47 345.72 -9.79 84802.00 56.00 -0.01
2013-04-06 05:45:00 7.11 345.77 -9.83 84791.00 57.00 -0.01
2013-04-06 06:00:00 6.79 346.72 -9.89 84778.00 58.00 -0.01
2013-04-06 06:15:00 6.40 346.80 -9.93 84694.00 58.00 -0.01
2013-04-06 06:30:00 6.28 349.27 -9.91 84660.00 55.00 -0.01
2013-04-06 06:45:00 6.07 350.27 -9.76 84698.00 53.00 0.00
2013-04-06 07:00:00 6.27 352.33 -9.34 84794.00 51.00 0.00
2013-04-06 07:15:00 6.47 353.90 -9.13 84798.00 49.64 0.00
2013-04-06 07:30:00 6.67 354.51 -8.93 84798.00 48.64 0.00
2013-04-06 07:45:00 6.84 354.70 -8.72 84802.00 47.00 0.00
2013-04-06 08:00:00 7.03 354.69 -8.49 84809.00 46.00 0.00
2013-04-06 08:15:00 7.12 354.77 -8.23 84799.00 44.00 0.00
2013-04-06 08:30:00 7.12 354.79 -8.01 84802.00 43.00 0.00
2013-04-06 08:45:00 7.02 353.51 -7.72 84802.00 41.64 0.00
2013-04-06 09:00:00 6.91 350.81 -7.44 84800.00 40.00 0.00
2013-04-06 09:15:00 6.81 347.75 -7.22 84809.00 39.00 0.00
2013-04-06 09:30:00 6.71 344.45 -6.92 84808.00 37.00 0.00
2013-04-06 09:45:00 6.78 340.79 -6.59 84814.00 36.00 0.00
2013-04-06 10:00:00 6.79 337.91 -6.29 84811.00 34.00 0.00
2013-04-06 10:15:00 6.99 335.80 -5.92 84799.00 32.00 0.00
2013-04-06 10:30:00 7.13 333.93 -5.60 84712.00 31.00 0.00
2013-04-06 10:45:00 7.29 333.74 -5.22 84703.00 29.00 0.00
2013-04-06 11:00:00 7.39 331.70 -4.93 84695.00 28.00 0.00
2013-04-06 11:15:00 7.50 329.60 -4.64 84693.00 28.00 0.00
2013-04-06 11:30:00 7.59 326.74 -4.28 84710.00 27.00 0.00
2013-04-06 11:45:00 7.53 324.74 -3.96 84625.00 26.00 0.00
2013-04-06 12:00:00 7.53 323.72 -3.63 84604.00 25.64 0.00
2013-04-06 12:15:00 7.60 322.72 -3.33 84600.00 25.00 0.00
2013-04-06 12:30:00 7.60 321.73 -3.03 84600.00 24.00 0.00
2013-04-06 12:45:00 7.70 320.75 -2.74 84592.00 23.00 0.00
2013-04-06 13:00:00 7.83 319.80 -2.45 84589.00 23.00 0.00
2013-04-06 13:15:00 8.10 318.81 -2.22 84504.00 22.00 0.00
2013-04-06 13:30:00 8.33 317.81 -1.96 84489.00 22.00 0.00
2013-04-06 13:45:00 8.52 317.71 -1.74 84493.00 21.00 0.00
2013-04-06 14:00:00 8.62 316.82 -1.53 84403.00 21.00 0.00
2013-04-06 14:15:00 8.62 316.79 -1.32 84403.00 21.00 0.00
2013-04-06 14:30:00 8.71 316.89 -1.02 84402.00 21.00 0.00
2013-04-06 14:45:00 8.72 316.95 -0.82 84399.00 21.00 0.00
2013-04-06 15:00:00 8.82 317.92 -0.59 84405.00 21.00 0.00
2013-04-06 15:15:00 8.83 318.84 -0.39 84311.00 21.00 0.00
2013-04-06 15:30:00 8.93 318.90 -0.19 84310.00 21.00 0.00
2013-04-06 15:45:00 9.03 318.89 -0.02 84300.00 21.64 0.00
2013-04-06 16:00:00 8.95 318.86 0.10 84306.00 21.64 0.00
2013-04-06 16:15:00 8.91 319.61 0.28 84299.00 22.00 0.00
2013-04-06 16:30:00 8.81 319.86 0.34 84319.00 22.00 0.00
2013-04-06 16:45:00 8.62 319.91 0.41 84307.00 22.00 0.00
2013-04-06 17:00:00 8.44 319.88 0.48 84300.00 22.00 0.00
2013-04-06 17:15:00 8.15 319.88 0.50 84304.00 22.00 0.00
2013-04-06 17:30:00 7.75 320.77 0.49 84300.00 22.00 0.00
2013-04-06 17:45:00 7.15 320.81 0.43 84215.00 22.00 0.00
2013-04-06 18:00:00 6.12 320.77 0.22 84199.00 23.00 0.00
2013-04-06 18:15:00 5.55 319.78 0.22 84194.00 23.00 0.00
2013-04-06 18:30:00 5.26 318.11 0.17 84198.00 24.00 0.00
2013-04-06 18:45:00 4.96 316.27 0.17 84190.00 24.64 0.00
2013-04-06 19:00:00 4.60 313.61 0.26 84180.00 25.00 0.00
2013-04-06 19:15:00 4.41 310.41 0.21 84160.00 26.00 0.00
2013-04-06 19:30:00 4.05 308.43 0.21 84156.00 26.76 0.00
2013-04-06 19:45:00 3.85 307.41 0.16 84140.00 27.00 0.00
2013-04-06 20:00:00 3.71 308.24 0.11 84126.00 27.36 0.00
2013-04-06 20:15:00 3.55 308.62 0.06 84110.00 28.00 -0.01
2013-04-06 20:30:00 3.33 309.09 0.01 84104.00 28.00 -0.01
2013-04-06 20:45:00 3.08 307.52 -0.04 84093.00 29.00 -0.01
2013-04-06 21:00:00 2.94 305.60 -0.04 84089.00 29.00 -0.01
2013-04-06 21:15:00 2.74 305.18 -0.04 84138.00 29.00 -0.01
2013-04-06 21:30:00 2.39 304.47 0.06 84121.00 29.00 -0.01
2013-04-06 21:45:00 2.07 302.31 0.06 84089.00 30.00 -0.01
2013-04-06 22:00:00 1.85 296.34 0.11 84057.00 30.00 -0.01
2013-04-06 22:15:00 1.79 286.30 0.12 84047.00 30.00 -0.01
2013-04-06 22:30:00 1.80 276.84 0.17 84029.00 30.00 -0.01
2013-04-06 22:45:00 2.00 267.35 0.17 83927.00 30.00 -0.01
2013-04-06 23:00:00 2.55 246.19 0.16 83888.00 30.64 0.00
2013-04-06 23:15:00 4.20 225.88 0.01 83681.00 31.64 0.00
2013-04-06 23:30:00 6.53 218.13 -0.29 83874.00 33.00 0.00
2013-04-06 23:45:00 8.14 216.01 -0.54 83929.00 34.00 0.00
2013-04-07 00:00:00 8.34 216.01 -0.68 83939.00 34.36 0.00
2013-04-07 00:15:00 7.91 218.39 -0.60 83929.00 34.00 0.00
2013-04-07 00:30:00 7.80 220.91 -0.50 83919.00 35.00 0.00
2013-04-07 00:45:00 7.74 224.92 -0.60 83921.00 35.36 0.00
2013-04-07 01:00:00 7.85 232.03 -0.71 83804.00 35.00 0.00
2013-04-07 01:15:00 7.83 235.95 -1.10 83592.00 34.00 0.00
2013-04-07 01:30:00 8.18 240.40 -1.25 83588.00 33.00 0.00
2013-04-07 01:45:00 8.40 242.01 -1.15 83474.00 34.00 -0.01
2013-04-07 02:00:00 8.65 242.59 -1.14 83698.00 34.00 0.00
2013-04-07 02:15:00 8.83 244.03 -1.09 83651.00 33.36 0.00
2013-04-07 02:30:00 9.00 243.81 -1.14 83695.00 33.00 0.00
2013-04-07 02:45:00 8.95 241.55 -1.33 83300.00 33.00 0.00
2013-04-07 03:00:00 9.10 239.06 -1.44 83342.00 33.00 0.00
2013-04-07 03:15:00 9.32 237.26 -1.50 83294.00 33.00 0.00
2013-04-07 03:30:00 9.59 236.23 -1.70 83290.00 33.00 0.00
2013-04-07 03:45:00 9.74 233.37 -1.90 83279.00 34.00 0.00
2013-04-07 04:00:00 9.94 229.83 -2.05 83247.00 34.00 -0.01
2013-04-07 04:15:00 10.23 229.39 -2.15 83243.00 34.00 -0.01
2013-04-07 04:30:00 10.42 231.46 -2.14 83181.00 34.00 -0.01
2013-04-07 04:45:00 10.56 233.87 -2.14 83183.00 33.00 -0.01
2013-04-07 05:00:00 10.71 237.72 -2.15 83197.00 33.00 -0.01
2013-04-07 05:15:00 11.02 241.41 -2.20 83211.00 33.00 -0.01
2013-04-07 05:30:00 11.06 243.75 -2.25 83182.00 33.00 -0.01
2013-04-07 05:45:00 10.97 244.90 -2.29 83084.00 33.00 -0.01
2013-04-07 06:00:00 10.95 246.94 -2.29 83057.00 33.00 -0.01
2013-04-07 06:15:00 11.26 249.74 -2.15 83056.00 32.00 -0.01
2013-04-07 06:30:00 11.30 250.52 -2.01 83112.00 31.00 -0.01
2013-04-07 06:45:00 10.78 249.92 -1.86 83545.00 30.00 0.00
2013-04-07 07:00:00 10.34 249.18 -1.80 83570.00 26.00 0.00
2013-04-07 07:15:00 10.35 250.57 -1.79 83588.00 25.00 0.00
2013-04-07 07:30:00 9.90 250.68 -1.33 83607.00 24.00 0.00
2013-04-07 07:45:00 10.17 254.62 -0.67 83597.00 22.64 0.00
2013-04-07 08:00:00 9.80 257.87 -0.22 83607.00 21.64 0.00
2013-04-07 08:15:00 10.02 265.23 0.33 83626.00 21.40 0.01
2013-04-07 08:30:00 10.10 270.93 0.78 83641.00 20.64 0.01
2013-04-07 08:45:00 9.85 274.59 1.16 83636.00 20.64 0.01
2013-04-07 09:00:00 9.73 276.80 1.51 83650.00 21.00 0.01
2013-04-07 09:15:00 9.74 280.44 1.89 83645.00 21.00 0.01
2013-04-07 09:30:00 9.91 284.37 2.24 83633.00 22.00 0.01
2013-04-07 09:45:00 10.10 289.15 2.53 83632.00 24.00 0.00
2013-04-07 10:00:00 10.20 293.03 2.78 83644.00 26.00 0.00
2013-04-07 10:15:00 10.21 294.98 2.93 83630.00 28.00 0.00
2013-04-07 10:30:00 10.27 295.96 3.05 83635.00 29.00 0.00
2013-04-07 10:45:00 10.19 295.99 3.12 83626.00 30.00 0.00
2013-04-07 11:00:00 10.16 296.05 3.19 83618.00 30.00 0.00
2013-04-07 11:15:00 10.08 296.11 3.19 83618.00 30.00 0.00
2013-04-07 11:30:00 10.08 296.14 3.16 83609.00 31.00 0.00
2013-04-07 11:45:00 10.04 296.99 3.11 83622.00 32.00 0.00
2013-04-07 12:00:00 9.84 297.01 3.12 83718.00 33.00 0.00
2013-04-07 12:15:00 9.71 297.13 3.15 83732.00 34.00 0.00
2013-04-07 12:30:00 9.53 297.84 3.20 83744.00 34.00 0.00
2013-04-07 12:45:00 9.45 298.08 3.29 83742.00 35.00 0.00
2013-04-07 13:00:00 9.35 299.08 3.31 83651.00 34.64 0.00
2013-04-07 13:15:00 9.37 300.02 3.28 83644.00 34.16 0.00
2013-04-07 13:30:00 9.46 300.83 3.23 83658.00 34.64 0.00
2013-04-07 13:45:00 9.46 301.15 3.23 83656.00 34.00 0.00
2013-04-07 14:00:00 9.36 303.12 3.23 83658.00 33.64 0.00
2013-04-07 14:15:00 9.28 306.75 3.22 83654.00 33.64 0.00
2013-04-07 14:30:00 9.26 309.85 3.15 83663.00 32.64 0.00
2013-04-07 14:45:00 9.19 311.72 3.13 83654.00 32.64 0.00
2013-04-07 15:00:00 9.46 313.01 3.01 83651.00 32.64 0.00
2013-04-07 15:15:00 9.44 313.99 2.84 83662.00 32.16 0.00
2013-04-07 15:30:00 9.14 313.98 2.68 83671.00 32.00 0.00
2013-04-07 15:45:00 8.67 313.93 2.51 83679.00 31.64 0.00
2013-04-07 16:00:00 8.36 313.99 2.39 83673.00 31.64 0.00
2013-04-07 16:15:00 7.97 315.99 2.29 83675.00 31.64 0.00
2013-04-07 16:30:00 7.77 318.02 2.20 83774.00 31.64 0.00
2013-04-07 16:45:00 7.66 320.03 2.09 83776.00 31.64 0.00
2013-04-07 17:00:00 7.49 321.94 1.96 83768.00 32.64 0.00
2013-04-07 17:15:00 7.47 322.94 1.78 83773.00 32.64 0.00
2013-04-07 17:30:00 7.48 323.76 1.59 83774.00 32.64 0.00
2013-04-07 17:45:00 7.52 325.02 1.37 83770.00 33.64 0.00
2013-04-07 18:00:00 7.70 327.05 1.05 83761.00 34.00 0.00
2013-04-07 18:15:00 7.89 329.17 0.80 83755.00 35.00 0.00
2013-04-07 18:30:00 7.98 332.09 0.55 83759.00 35.64 0.00
2013-04-07 18:45:00 8.06 335.06 0.26 83770.00 35.64 -0.01
2013-04-07 19:00:00 8.22 338.05 -0.04 83784.00 35.64 -0.01
2013-04-07 19:15:00 8.42 340.02 -0.24 83788.00 36.16 -0.01
2013-04-07 19:30:00 8.65 342.01 -0.54 83783.00 36.40 -0.01
2013-04-07 19:45:00 8.91 343.60 -0.84 83784.00 37.64 -0.01
2013-04-07 20:00:00 9.19 343.90 -1.24 83701.00 39.64 -0.01
2013-04-07 20:15:00 9.40 344.79 -1.55 83610.00 41.64 -0.01
2013-04-07 20:30:00 9.41 345.01 -1.95 83527.00 44.00 -0.01
2013-04-07 20:45:00 9.24 346.84 -2.25 83441.00 46.00 -0.01
2013-04-07 21:00:00 9.06 349.18 -2.54 83358.00 47.00 -0.01
2013-04-07 21:15:00 8.87 353.03 -2.84 83296.00 49.00 -0.01
2013-04-07 21:30:00 8.87 356.90 -3.14 83246.00 50.00 0.00
2013-04-07 21:45:00 8.69 359.43 -3.39 83175.00 50.00 0.00
2013-04-07 22:00:00 8.70 0.74 -3.64 83123.00 49.00 0.00
2013-04-07 22:15:00 9.09 2.79 -3.75 83078.00 47.00 0.00
2013-04-07 22:30:00 9.47 3.91 -4.15 82983.00 47.00 -0.01
2013-04-07 22:45:00 9.39 5.72 -4.65 82972.00 50.00 0.00
2013-04-07 23:00:00 9.01 2.95 -5.16 83123.00 54.64 -0.01
2013-04-07 23:15:00 8.57 1.95 -5.86 83446.00 62.64 -0.01
2013-04-07 23:30:00 7.95 2.95 -6.40 83640.00 71.16 -0.01
2013-04-07 23:45:00 7.43 7.06 -6.75 83765.00 77.00 -0.01
我需要根据配置文件的要求获取相应station下面的数据,而且获取的数据入库要求是从00:15:00开始,到下一天00:00:00算一个天。所以在判断的时候,是先放入缓存MAP中,后比较时间标识。
除此,在删除数据文件的时候,一定要先关掉流,再执行删除操作,负责会失败。
5,接下来是定时执行程序ReaderTimerTask,他继承了TimerTask类,在这个类中,获取了配置参数,然后调用了DataReader解析WPD数据,调用DataWriter写入数据库。
public class ReaderTimerTask extends TimerTask {
@Override
public void run() {
Map map = ConfigerReader.getInstance().getConfigerReader(Parameter.configer);
String wfId = map.get(Parameter.WFID).toString().trim();
if (!"".equals(wfId.toString())) {
System.out.println("获取电场ID成功!");
} else {
System.out.println("获取电场ID失败!");
return;
}
String stationId = map.get(Parameter.STATIONID).toString().trim();
if (!"".equals(stationId.toString())) {
System.out.println("获取气象站ID成功!");
} else {
System.out.println("获取气象站ID失败!");
return;
}
String localDir = map.get(Parameter.LOCALDIR).toString().trim();
if (!"".equals(localDir)) {
System.out.println("获取本地文件目录成功!");
} else {
System.out.println("获取本地文件目录失败!");
return;
}
String backDir = map.get(Parameter.BACKDIR).toString().trim();
if (!"".equals(backDir)) {
System.out.println("获取文件备份目录成功!");
} else {
System.out.println("获取文件备份目录失败!");
return;
}
String driver = map.get(Parameter.DRIVER).toString().trim();
if (!"".equals(driver)) {
System.out.println("获取数据库驱动成功!");
} else {
System.out.println("获取数据库驱动失败!");
return;
}
String url = map.get(Parameter.URL).toString().trim();
if (!"".equals(localDir)) {
System.out.println("获取数据库URL成功!");
} else {
System.out.println("获取数据库URL失败!");
return;
}
DBConnecter dbcon = DBConnecter.getInstance();
if (dbcon != null) {
System.out.println("数据库连接成功!");
} else {
System.out.println("数据库连接失败!");
return;
}
DataWriter writer = new DataWriter();
DataReader reader = new DataReader();
List> dataMaps = reader.readFileByLines(localDir, backDir,
Integer.parseInt(wfId), Integer.parseInt(stationId));
writer.writeData(dbcon, dataMaps, driver, url);
}
}
6,最后就是主函数类WPDAnalysis。这个类也获取了读取参数类。并根据读取的参数设置执行时间。
public class WPDAnalysis {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Map map = ConfigerReader.getInstance().getConfigerReader(Parameter.configer);
String wftime1 = map.get(Parameter.WFTIME1).toString();
String wftime2 = map.get(Parameter.WFTIME2).toString();
Timer timer = new Timer();
//设置执行时间
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);//每天
int hour = 9;
int minute = 00;
int second = 00;
//定制每天的09:00:00执行,
if (!"".equals(wftime1.trim())) {
int time = Integer.parseInt(wftime1);
hour = time / 3600;
minute = time % 3600 / 60;
second = time % 3600 % 60;
}
calendar.set(year, month, day, hour, minute, second);
Date date = calendar.getTime();
System.out.println("服务第一次执行开始,当前时间为" + date.toString());
timer.schedule(new ReaderTimerTask(), date, Parameter.READERRATE);
if (!"".equals(wftime2.trim())) {
int time = Integer.parseInt(wftime2);
hour = time / 3600;
minute = time % 3600 / 60;
second = time % 3600 % 60;
calendar.set(year, month, day, hour, minute, second);
System.out.println("服务第二次执行开始,当前时间为" + date.toString());
date = calendar.getTime();
timer.schedule(new ReaderTimerTask(), date, Parameter.READERRATE);
}
}
}
public final class Parameter {
//主配置文件
public final static String configer = "D:\\Analysis\\configer.properties";
//数据库属性
public final static String WFID = "WFID";
public final static String STATIONID = "STATIONID";
public final static String WFNAME = "WFNAME";
public final static String WFTIME1 = "WFTIME1";
public final static String WFTIME2 = "WFTIME2";
public final static String DRIVER = "DRIVER";
public final static String URL = "URL";
public final static String USER = "USER";
public final static String PWD = "PWD";
public final static String DB = "DB";
//文件操作属性
public final static String LOCALDIR = "LOCALDIR";
public final static String BACKDIR = "BACKDIR";
public final static int READERRATE = 10 * 1000;
//文本属性
public final static String[] pName = {"wfid", "nwpdate", "daytype", "uavg", "vavg", "temperature", "pressure", "humidity", "vspeed"};
public final static String FORMAT_STR = "yyyy-MM-dd HH:mm:ss";
//SQL插入语句
public final static String sql_insert = "insert into nwpdata(wfid,datatime,nwptime,daytype,temperature,pressure,humidity) "
+ "values (?,?,?,?,?,?,?)";
//SQL备份插入语句
public final static String sql_minsert = "insert into nwpdatam(wfid,datatime,nwptime,daytype,temperature,pressure,humidity) "
+ "values (?,?,?,?,?,?,?)";
public final static String sql_update = "update nwpdata set datatime = ?,uavg4 = ?, vavg4 = ?,"
+ "temperature = ?,pressure = ?,humidity = ? "
+ "where wfid = ? and nwptime = ? and daytype = ?";
public final static String sql_select = "select * from nwpdata where wfid = ? and nwptime = ? and daytype = ?";
}
程序的配置文件类如下:
[SERVICE]
WFTIME1=28800
WFTIME2=
WFID=1
STATIONID=54
[DATABASE]
TYPE=sql_server
DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver
URL=jdbc:sqlserver://192.168.10.104;user=sa;password=cast1234;database=DB
USER=sa
PWD=cast1234
DB=DB
[NRFMNWP]
LOCALDIR=D:\\Analysis\\Output
BACKDIR=D:\\Analysis\\Back
二、整个项目需要打包生成WPDAnalysis.jar,然后我们就可以做我们的window服务了。
第一步在http://wrapper.tanukisoftware.com/doc/english/download.jsp下载我们的java service wrapper工具,下载后解压。工具分32位跟64位,看自己所需。
第二步构建你的程序工作目录,比如我构建D:\WPDAnalysis_64。然后在目录下建造lib,logs,bin,conf等文件夹。其实目录名字也可以自己随便定义,只要最后配置正确即可。同时把你的WPDAnalysis.jar也放在D:\WPDAnalysis_64下面。
第三步把解压后的文件夹中src\bin中的文件复制到新建的bin文件夹下面。并把所有文件的in后缀去掉。同时把解压后文件夹中bin下的wrapper.exe也放到新建的bin下。
第四步把解压后的文件夹中src\conf中的文件复制到新建的conf文件夹中。把in后缀去掉。
第五步把解压后的文件夹中lib中的wrapper.jar与wrapper.dll放大新建的lib下面。同时把WPDAnalysis程序所需要的第三方jar包夜放在这里。我这里使用sqljdbc4.jar。
第六步配置wrapper.conf文件,主要配置选项如下:
#Java的位置
wrapper.java.command=D:\Java\jdk1.6.0_31\bin\java
#如果你系统已经配置了%JAVA_HOME%的环境变量,上面的就可以不配置了。如下:
#wrapper.java.command=%JAVA_HOME%/bin/java
#classpath:
wrapper.java.classpath.1=../WPDAnalysis.jar
wrapper.java.classpath.2=../lib/wrapper.jar
wrapper.java.classpath.3=../lib/sqljdbc4.jar
# Java Library Path (取决于Wrapper.DLL 或者libwrapper.so)
wrapper.java.library.path.1=../lib
#MAIN CLASS 此处决定了使用Java Service Wrapper的方式
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
#你的Java应用类,我这里是这样子
wrapper.app.parameter.1=wpdanalysis.WPDAnalysis
#服务名称
wrapper.name=WPDAnalysis_64
#服务部署名称,会显示到window服务中的名称栏
wrapper.displayname=Analysis WPD Data Into DataBase For X64
#服务的描述
wrapper.description=Analysis WPD Data Into DataBase For X64
配置以后,点击bin文件夹下面的App.bat进行测试,如果能够在console中出现正常结果的话就表明配置正确。然后点击InstallApp-NT.bat安装服务,也可以点击UninstallApp-NT.bat卸载服务。成功安装服务后可以在window服务管理中看到哦。
以上就是java程序做成服务的步骤。