Commit 0afe921a by 余根龙

绿信比

parent c4db3a4d
......@@ -13,24 +13,18 @@ import java.sql.PreparedStatement;
* domain traffic
*/
public class GreenRadioSink extends RichSinkFunction<Cycle> {
Connection connection;
PreparedStatement insertPstmt;
PreparedStatement updatePstmt;
@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
// path暂定为固定值
String path = "F:\\workspace\\ZHHT-IRN-BD-ANALYSIS\\realtime\\hologram-streaming\\src\\main\\resources\\mysql.properties";
connection = MySQLUtils.getConnection(path);
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=?");
}
@Override
public void close() throws Exception {
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