One simple but useful note:check whether your TNS Listener is running! By default, it's not started automatically when an Oracle instance is started. Login as oracle then type :
lsnrctl START
After it's started, I can sucessfully run the sample code on this page! I used to got ora-12514 error before doing this.