JDBC: Executing Statements


Overview/Description
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description

Java Database Connectivity (JDBC) offers a number of ways in which SQL queries can be executed using a number of built-in objects. This demo-based course covers the use of the fundamental JDBC objects required to set up and manage database connections from a Java app and to execute queries. You will cover the use of Properties objects to load connection details, and then the use of the Statement and PreparedStatement instances to run SELECT, INSERT, DELETE and UPDATE queries against a database from a Java app.



Expected Duration (hours)
1.4

Lesson Objectives

JDBC: Executing Statements

  • discover the key concepts covered in this course
  • identify the different ways to specify connection details when connecting to a database using JDBC
  • use database connection details in a properties file to set up a connection to a database using JDBC
  • adopt a DataSource object to create a Connection with a database
  • execute a SQL query to create a database table from a Java app
  • run a SELECT query against a database and access the returned tabular data in a JDBC ResultSet object
  • add rows to a database table by running an INSERT query from a Java app
  • modify the contents of a database table from a Java app by executing UPDATE and DELETE queries
  • drop a table and database from a Java app
  • recognize the limitations of the Statement object when several executions of similar queries are involved
  • optimize the execution of similar queries by parametrizing them with PreparedStatements
  • recall the types of exceptions that could occur when passing incorrect parameters to a PreparedStatement
  • identify some of the exceptions that could be thrown when using JDBC to work with databases
  • summarize the key concepts covered in this course
  • Course Number:
    it_jmjdbcdj_02_enus

    Expertise Level
    Beginner