Scott data set in hsqldb format
This project contains the Scott data set as an HSQLDB database.
It originated as the "Scott/Tiger" account that has been installed with Oracle since time immemorial.
Add the following to your Maven pom.xml:
<dependencies>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>net.hydromatic</groupId>
<artifactId>scott-data-hsqldb</artifactId>
<version>0.2</version>
</dependency>
</dependencies>
(scott-data-hsqldb supports HSQLDB 2.0.0 and higher, and Java 8 and higher; note that HSQLDB 2.6.0 and higher requires Java 11 and higher.)
Connect to the database via the URL, user name and password in the
ScottHsqldb
class:
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import net.hydromatic.scott.data.hsqldb;
Connection connection =
DriverManager.getConnection(ScottHsqldb.URI, ScottHsqldb.USER, ScottHsqldb.PASSWORD);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("select * from EMP");
Connect from the command line using the SQLLine shell:
$ ./sqlline
sqlline version 1.12.0
sqlline> !connect jdbc:hsqldb:res:scott SCOTT TIGER
0: jdbc:hsqldb:res:scott> select * from dept;
+--------+----------------+---------------+
| DEPTNO | DNAME | LOC |
+--------+----------------+---------------+
| 10 | ACCOUNTING | NEW YORK |
| 20 | RESEARCH | DALLAS |
| 30 | SALES | CHICAGO |
| 40 | OPERATIONS | BOSTON |
+--------+----------------+---------------+
4 rows selected (0.002 seconds)
You may need to edit the sqlline
or sqlline.bat
launcher script,
adding scott-data-hsqldb.jar
to your class path.
Get scott-data-hsqldb from Maven Central:
<dependency>
<groupId>net.hydromatic</groupId>
<artifactId>scott-data-hsqldb</artifactId>
<version>0.2</version>
</dependency>
Use Java version 11 or higher.
$ git clone git://github.com/julianhyde/scott-data-hsqldb.git
$ cd scott-data-hsqldb
$ ./mvnw install
On Windows, the last line is
> mvnw install
Similar data sets:
- chinook-data-hsqldb
- flight-data-hsqldb
- foodmart-data-hsqldb
- foodmart-data-json
- foodmart-queries
- steelwheels-data-hsqldb
- License: Apache License, Version 2.0
- Author: Julian Hyde
- Blog: http://blog.hydromatic.net
- Project page: https://www.hydromatic.net/scott-data-hsqldb
- Source code: https://github.com/julianhyde/scott-data-hsqldb
- Distribution: Maven Central
- Developers list: dev at calcite.apache.org (archive, subscribe)
- Issues: https://github.com/julianhyde/scott-data-hsqldb/issues
- Release notes and history