Bummer! That workshop has been retired.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Course Introduction 1:52
- Introduction to Data Persistence 3:18
- Review of DB Concepts 3 questions
- Review of SQL 7:19
- SQL Review 5 questions
- Using Java to Connect to a Database 13:55
- Using JDBC to Connect to a Database 2 objectives
- Save a Java Object to a Database 6:27
- The Case for Object-Relational Mapping 2:43

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Up to this point, you have interacted only directly with a database using SQL. You will now tackle the task of using Java for connecting to a database.
Documentation for SQLite's JDBC Class
Looking at the documentation for org.sqlite.JDBC
, you'll see that it declares a static member as follows:
static {
try {
DriverManager.registerDriver(new JDBC());
}
catch (SQLException e) {
e.printStackTrace();
}
}
Later, when JDBC is used for establishing a connection, the acceptsURL(String)
method is used for determining which of the registered drivers should be used with the supplied connection string. Following the call to isValidURL(String)
, you can see that as long as the connection string begins with "jdbc:sqlite:" (see PREFIX
), this SQLite implementation of java.sql.Driver
will be used.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Ahmed SanaUllah
640 Points0 Answers
-
Hannah Villafuerte
2,916 Points1 Answer
-
Shadd Anderson
Treehouse Project Reviewer4 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up