- Make sure that you can reach port 1521 of your database host from wherever you are executing your java code.
- Make sure too that you can connect to your database with some standard database client (SQL*plus for example) in order to check if your database is configured right
- Check your connection URL to make sure if it is right (docs on that here http://www.orafaq.com/wiki/JDBC)
Besides that, just a remark: if your idea is to educate yourself or learn JDBC, this is perfectly right; if your code is intended for production, I strongly advise you against mixing database access into your presentantion layer (JSP). I suggest you consider in that case to split your application in layers defined by its responsability. http://en.wikipedia.org/wiki/Multitier_architecture