How to connect to Oracle database from Java Program using JDBC API is common need for many Java programmer, though there are lot of framework available which has simplified JDBC development e.g hibernate, Spring JdbcTempate and many more, but creating Java program to connect to oracle database from plain old Java is still most easy and quickest method for testing and debugging database connectivity. Database connection program is also a common Java programming exercise in many Java programming courses on school, colleges and various training institutes. We have been exploring some advanced concepts and best practices on JDBC in my previous articles like Why should you use PreparedStatement in Java and 4 JDBC performance tips for Java application , which you may like if you are on more advanced level. This simple java program is intended for beginners in Java which have just started learning JDBC API.
If you like to read tutorials on database then you may find difference between truncate and delete , 10 example of SQL SELECT queries and how to manage database transaction useful and interesting.