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.
http://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html[
^]
Then when it comes to inserting here is another link :
http://www.devdaily.com/java/edu/pj/jdbc/jdbc0002[
^]
Also here there is a ton of information on the web.