Have a look at the Oracle tutorials. There's example code.