JDBC Statement Example

Statement interface object is used to execute queries.

  • It executes query immediately without compiling
  • It has 3 methods to execute query
    • execute(“sql query”)
    • executeQuery(“sql query”)
    • executeUpdate(“sql query”)
  • Each of them throws SQLException

JDBC Oracle Connectivity Example (Gujarati)

  • JDBC connectivity with oracle database. In this tutorial I have tried to connect java program to oracle database.
  • Oracle driver (jar files) is required to connect with oracle database.
  • One need to add driver file to eclipse project as an external libraries
  • Driver has to loaded with Class.forName() method. – Finally, one can declare valid Connection object which will be able to connect with oracle database.