- JDBC: Java Database Conectivity
-
DBMS: Database Management System - mySql, Oracle, PostgreSQL, RDBMS, Microsoft Access, etc
- connection mySQL with Java via phpMyAdmin
- download MAMP for mac or WAMP for windows
- Set up mySQL JDBC Driver on Eclipse Referenced Libraries
- Build Path > Configure Build Path > Libraries > Add External Jars > browse to folder containing the driver(mysql-connector-java-8.0.15.jar)
Error 1
- when create table, SQLException
java.sql.SQLException: The server timezone value 'UTC' is unrecognized or represents more than one timezone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc timezone value if you want to utilize timezone support.
- How to fix it
import java.util.TimeZone;
- add
?serverTimezone=" + TimeZone.getDefault().getID()
to connection of String URLpublic static final String URL = "jdbc:mysql://localhost:8889/firstDB?serverTimezone=" + TimeZone.getDefault().getID();