Skip to content

Instantly share code, notes, and snippets.

@brunkb
Last active September 27, 2015 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunkb/b9a9cdb641efc396cc5e to your computer and use it in GitHub Desktop.
Save brunkb/b9a9cdb641efc396cc5e to your computer and use it in GitHub Desktop.
Class.forName(JDBC_DRIVER)
Connection conn = DriverManager.getConnection(creds.url, creds.userName, creds.password)
String updateTableSQL = "update Book set title=? where id=?"
PreparedStatement preparedStatement = conn.prepareStatement(updateTableSQL)
preparedStatement.setString(1, title)
preparedStatement.setInt(2, id)
preparedStatement.executeUpdate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment