Commit 0afe921a by 余根龙

绿信比

parent c4db3a4d
...@@ -13,24 +13,18 @@ import java.sql.PreparedStatement; ...@@ -13,24 +13,18 @@ import java.sql.PreparedStatement;
* domain traffic * domain traffic
*/ */
public class GreenRadioSink extends RichSinkFunction<Cycle> { public class GreenRadioSink extends RichSinkFunction<Cycle> {
Connection connection; Connection connection;
PreparedStatement insertPstmt; PreparedStatement insertPstmt;
PreparedStatement updatePstmt; PreparedStatement updatePstmt;
@Override @Override
public void open(Configuration parameters) throws Exception { public void open(Configuration parameters) throws Exception {
super.open(parameters); super.open(parameters);
// path暂定为固定值 // path暂定为固定值
String path = "F:\\workspace\\ZHHT-IRN-BD-ANALYSIS\\realtime\\hologram-streaming\\src\\main\\resources\\mysql.properties"; String path = "F:\\workspace\\ZHHT-IRN-BD-ANALYSIS\\realtime\\hologram-streaming\\src\\main\\resources\\mysql.properties";
connection = MySQLUtils.getConnection(path); connection = MySQLUtils.getConnection(path);
insertPstmt = connection.prepareStatement("insert into app_cycle_green_ratio(id,cross_code,green_radio) values (?,?,?)"); insertPstmt = connection.prepareStatement("insert into app_cycle_green_ratio(id,cross_code,green_radio) values (?,?,?)");
//updatePstmt = connection.prepareStatement("update wyf_test set lxb=? where cross_code=?"); //updatePstmt = connection.prepareStatement("update wyf_test set lxb=? where cross_code=?");
} }
@Override @Override
public void close() throws Exception { public void close() throws Exception {
super.close(); super.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment