First setup a connection to your database.
Before trying to actually access the database from your program, try to connect to it using sqlplus from your development machine. This way you know that the connection string and tnsnames.ora is correct.
There is tons of information about this on the web.
Then when it comes to inserting here is another link :
Also here there is a ton of information on the web.