Creating a database and its structure
Look up how to download and install your preferred database server. A database server is a software system that maintains and manages the database. For our demonstrations, we are going to use PostgreSQL, a free, open source database server.
After the database server is installed, we'll use its console for creating a database and its user with the corresponding permissions. There are many ways to structure the data store and the system of users with different levels of access. In this book, we will introduce only the basic approach, which allows us to demonstrate the main JDBC capabilities.
CREATE and DROP the database and its user
Read the database instructions and create, first, a java
user and a javaintro
database (or select any other name you prefer and use them instead in the provided code examples). Here is how we did it for PostgreSQL:
CREATE USER java SUPERUSER; CREATE DATABASE javaintro OWNER java;
If you made a mistake and decide to start anew...