Advertisement
Guest User

insertKey

a guest
Mar 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public void insertKey(String id, String key)
  2. {
  3. Connection connection = getConnection();
  4.  
  5. try
  6. {
  7. String insertSQL = "insert into privacy(id, key) values (?,?)";
  8. PreparedStatement psmt = connection.prepareStatement(insertSQL);
  9. psmt.setString(0, x);
  10. psmt.setString(1, x);
  11. int keyCount = psmt.executeUpdate();
  12. System.out.println("Executed update - Key Count: " + keyCount);
  13. }
  14. catch(SQLException e)
  15. {
  16. e.printStackTrace();
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement