Join David Gassner for an in-depth discussion in this video Connecting to a HyperSQL database file, part of Java Database Integration with JDBC.
- View Offline
In order to provide a contrast between different database management systems, I'm going to be…showing how to connect both to MySQL and to HyperSQL.…HyperSQL is one of a number of 100% Java-based databases. Others include Apache Derby and H2.…I have chosen a HyperSQL because its databases are defined in pure text files, which makes…them very easy to use in a training environment.…You can get the Drivers and all the documentation for HyperSQL from hsqldb.org. You'll see hyperSQL…preferred to both by the name HyperSQL and HSQLDB. Just as with MySQL, you can download…the Drivers for free, but I have provided the driver for HSQLdb as part of the free exercise…files that accompany the course.…
I'll go to my libs folder, and I'll copy the file hsqlbd.jar to the clipboard, then I will return to Eclipse.…I'm working with a copy of my first project, this one is called ConnectHSQLDB, and it's…available in the exercise files, this starting version of the project is already set up for…use with MySQL, and I'm going to make some changes so that it works with HSQLDB instead.…
Author David Gassner explains how to choose a JDBC driver and connect to one or more databases. He also provides detailed instructions on reading, selecting, and updating data; calling stored procedures; managing data via JavaBean classes or with prepared statements; and working with metadata.
- Importing a MySQL database
- Connecting to databases
- Handling JDBC exceptions
- Looping through result sets
- Limiting the number of fetched rows
- Filtering data with prepared statements
- Calling stored procedures
- Inserting, updating, and deleting rows with prepared statements
- Using a persistent database connection
- Committing and rolling back transactions