Guest User

Untitled

a guest
Aug 15th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. INSERT new row into database java?
  2. try {
  3. Main.db.getCon().createStatement().executeUpdate("INSERT INTO qos_qoe (channel_id) VALUES ('vtv1') ");
  4. Main.db.getCon().createStatement().executeUpdate("UPDATE qos_qoe SET channel_id = 'vtv1' WHERE id = 3 ");
  5.  
  6. } catch (SQLException e) {
  7. // TODO Auto-generated catch block
  8. e.printStackTrace();
  9. }
  10.  
  11. String statement = "UPDATE iptv_media_source SET rated = ?, vote_count = ? WHERE channel_id= ? ";
  12. PreparedStatement st = Main.db.getCon().prepareStatement(statement);
  13. st.setString(1, rated);
  14. st.setString(2, vote_count);
  15. st.setString(3, channelId);
  16. st.executeUpdate();
Add Comment
Please, Sign In to add comment