PostgreSQL Tutorial

  • Home
  • Stored Procedures
  • Triggers
  • Views
  • Interfaces
    • PostgreSQL PHP
    • PostgreSQL Python
    • PostgreSQL JDBC
  • Functions
Home / PostgreSQL JDBC

PostgreSQL JDBC

In this PostgreSQL JDBC section, you will learn how to interact with the PostgreSQL databases using Java JDBC driver.

JDBC is the core API of Java that provides a standard interface to SQL-compliant databases, especially PostgreSQL.

PostgreSQL JDBC TutorialFirst, we start the tutorials by showing you how to download PostgreSQL JDBC driver and setup environment for developing Java applications that connect to a PostgreSQL database server.

Then, we show you how to connect the PostgreSQL database server and perform various operations such as querying, inserting, updating and deleting data. We also cover the database transaction in PostgreSQL via JDBC API.

To follow the tutorials, you need to have basic knowledge of Java programming language and know how to interact with PostgreSQL database server such as connecting to the PostgreSQL database server and querying data using the SELECT statement. You are not required to have the JDBC knowledge to understand the code because we will explain each line of code in detail.

You can follow the tutorials in sequence or you can jump directly to the interested tutorial based on the solution that you are looking for.

  • Setting up the environment and connecting to the PostgreSQL database server – shows you how to download JDBC driver, setup NetBean IDE, and develop a Java program that connects to a PostgreSQL database server.
  • Querying data from the PostgreSQL database – walks you through the steps of querying data from a table. We also show you how to return the number of rows in a specific table.
  • Inserting data into a table – guides you how to insert a row into a table. In addition, we show you step by step how to perform the batch insert using JDBC batch update API.
  • Updating data in a table – provides you with the steps of updating existing data in a table.
  • Deleting data from a table – you will learn how to delete rows in a table using the PreparedStatement object.
  • Performing the database transaction by using the commit and rollback methods of the Connection object – shows you how to develop a program that performs the PostgreSQL transactions using JDBC API.
  • Calling PostgreSQL stored functions – shows you how to call PostgreSQL stored functions including built-in and user-defined stored functions.

For the demonstration purpose, we will use the dvdrental sample database. It is faster and easier to follow the tutorials if you download and load this sample database into your PostgreSQL database server.

Previous Tutorial: PostgreSQL Python
Next Tutorial: PostgreSQL Cheat Sheet

PostgreSQL Quick Start

  • What is PostgreSQL?
  • Install PostgreSQL
  • Connect to Database
  • Download PostgreSQL Sample Database
  • Load Sample Database
  • Explore Server and Database Objects

PostgreSQL JDBC

  • Connect To PostgreSQL Database in JDBC
  • Query Data from PostgreSQL using JDBC
  • Insert Data Into a Table Using JDBC
  • Update Data in PostgreSQL Using JDBC
  • Call PostgreSQL Stored Function in JDBC
  • Delete Data From PostgreSQL Using JDBC
  • PostgreSQL JDBC Transaction

About PostgreSQL Tutorial

PostgreSQLTutorial.com is a website dedicated to developers and database administrators who are working on PostgreSQL database management system.

We constantly publish useful PostgreSQL tutorials to keep you up-to-date with the latest PostgreSQL features and technologies. All PostgreSQL tutorials are simple, easy-to-follow and practical.

Recent PostgreSQL Tutorials

  • How To Change The Password of a PostgreSQL User
  • PostgreSQL AGE Function
  • PostgreSQL DATE_PART Function
  • PostgreSQL List Users
  • PostgreSQL NOW Function
  • PostgreSQL DATE_TRUNC Function
  • PostgreSQL TO_DATE Function: Convert String to Date
  • A Look at PostgreSQL User-defined Data Types
  • PostgreSQL Copy Database Made Easy
  • How to Get Table, Database, Indexes, Tablespace, and Value Size in PostgreSQL

More Tutorials

  • PostgreSQL Cheat Sheet
  • PostgreSQL Administration
  • PostgreSQL PHP
  • PostgreSQL Python
  • PostgreSQL JDBC
  • PostgreSQL Resources

Site Info

  • Home
  • About Us
  • Contact Us
  • Privacy Policy

Copyright © 2017 by PostgreSQL Tutorial Website. All Rights Reserved.