CPSC 343 | Database Theory and Practice | Fall 2020 |
This document is intended to describe the local environment for working with JDBC in CPSC 343. Refer to the Java Tutorial for information on using JDBC.
JDBC is an API for connecting to a database. You need a connector for your particular database in order to be able to use it.
Download and install Connector/J 8.0.22, the JDBC connector for MySQL. Note where the jar file gets installed.
Once you have the JDBC connector, you'll need to add it to the build path of every Java project that connects to a database. In Eclipse:
Right-click on the project name in the Package Explorer and choose Build Path->Configure Build Path.
Click on "Build Path" in the list of categories on the left side of the dialog box.
Click on the "Libraries" tab.
Click "Add External JARs", navigate to where the jar file got installed when you installed the JDBC connector, and select it. (The name should be mysql-connector-java-8.0.22.jar or similar.)
Click "Apply and Close" when you are done.
You will need to do this each time you create a new project.
|