If you want to modify the JCR (for example - add a node, add a property, etc) from an external Java app - you can follow this article. Make sure that you include the correct Jackrabbit JAR file in your classpath (discussed in the article) .
Adobe Experience Manager Help | Programmatically Accessing Adobe Experience Manager Content using th...
If you want to learn how to build WEB SITES in AEM - follow this:
Getting Started with AEM Sites - WKND Tutorial
PS - the code you are showing in your thread is not referenced in the article you said you are following.