Java-database connection Java-MySQL connection ①: JDBC and JDBC driver overview / September 2017

Introduction

It will be a personal memo that divides the process of connecting the Java database into 5 stages. We apologize for any inconvenience, but we would appreciate it if you could teach us!

Java-database connection / Java-MySQL connection ① Overview of JDBC and JDBC driver (2) JDBC driver acquisition method (for MySQL) and data connection preparation ③-1 How to set CLASSPATH in environment variable ③-2 How to set CLASSPATH to Eclipse build busLoad JDBC driverConnect to database (MySQL) to search table information and display search results

Overview

To connect to a database using a Java program, you need to use a mechanism called "JDBC (Java DataBase Connectivity)".

JDBC is a general term for APIs for accessing databases such as MySQL and PostgreSQL and spreadsheets (data files) such as Excel from Java language programs.

In order to use JDBC, the vendors that provide each database and the vendors that provide spreadsheets provide parts called "JDBC drivers". To connect to a database or spreadsheet, you need to download the "JDBC driver".

This is because the standard system libraries provided by the JDK do not include the components to connect to each database or spreadsheet.

The standard system library provided by the JDK includes the "JDBC Driver Manager", which is used to call the JDBC driver. The JDBC driver connects to the database specified by the JDBC driver manager.

image.png


Java-database connection / Java-MySQL connection ① Overview of JDBC and JDBC driver (2) JDBC driver acquisition method (for MySQL) and data connection preparation ③-1 How to set CLASSPATH in environment variable ③-2 How to set CLASSPATH to Eclipse build busLoad JDBC driverConnect to database (MySQL) to search table information and display search results


Recommended Posts

Java-database connection Java-MySQL connection ①: JDBC and JDBC driver overview / September 2017
Java-database connection Java-MySQL connection ④: JDBC driver loading / September 2017
Java-database connection Java-MySQL connection (2): JDBC driver acquisition method (for MySQL) and data connection preparation / September 2017
Java-database connection Java-MySQL connection ⑤: Connect to the database (MySQL) to search table information and display search results / September 2017
Java-database connection Java-MySQL connection ③-1: How to set CLASSPATH in environment variable / September 2017
JDBC connection mapper that eats SQL and returns beans