Create a SQLite database by importing csv files created from your Ms Excel version of your database. How to install SQLite, importing your tables, installing the drivers into your Java programs, how to connect to the database.
- You have got your PAT to work with a three class OOP application that reads from a text file.
- You have made a serious start on your GUIs. They are designed and are linked together.
- You have made a serious start on your documentation – describing your database structure, your class diagrams, your program flow etc
But this feels a bit strange if the SQL database does not exist yet. How do we create it, connect to it and send it SQL queries that you have written?
NOTE: This solution is based on SQLite. I feel that this is the best solution for your PAT for many reasons. There are many other good solutions that all work (but can be a lot more complex). SQLite is open source and is perhaps the most used code on the planet – it is even in your browser software. Most of the apps on your phone use SQLite to store their data.
SQL Part one. Creating a robust CSV file that you can import into SQLite.
SQL. Part two. Downloading SQLite Studio and the java driver library for sqlite. Importing the driver into our Java project
SQL. Part three. Importing your CSV file and saving your SQLite database into your Java project
SQL. Part four. Coding your Java class to connect and query your database.
Download the code from part four here
SQL. Part five. Read in the whole database into an array of create objects
Download the code from part five here.
SQL. Part six. Overview notes on creating an array of objects from a SQLite database
Download the the code from part six here.
Here is a link to a SQLite online tutorial