JDBC
- Java Database Connectivity
Basic Process
- get JAR file for each DB
- Prepare username, password, jdbcurl for db
- Create
Connection
- Create
PreparedStatement
- Get
Result
from 4.
- Work with
Result
- Close
Result
- Close
PreparedStatement
- Close
Connection
Sample
DB Info
spring.datasource.username=devuser
spring.datasource.password=devpass
spring.datasource.url=jdbc:postgresql://localhost:5432/devdb
spring.datasource.platform=postgres
spring.datasource.url=jdbc:mariadb://localhost:3306/devdb
spring.datasource.platform=mariadb
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/devdb
spring.datasource.platform=mysql
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:devdb
spring.datasource.platform=oracle
# spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# spring.datasource.driver-class-name=org.postgresql.Driver
# spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
# spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.datasource.hikari.maximum-pool-size=4
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql: true