Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to start an HSQLDB server for testing #66

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions idea.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,41 @@ and in webapp.pom
<!-- Needed for intellij to setup processor properly, not needed with maven only -->
<scope>provided</scope>
</dependency>


# HSQL server for debugging test

Start an HSQL Server:

```shell
java -cp ~/.m2/repository/org/hsqldb/hsqldb/2.5.2/hsqldb-2.5.2.jar org.hsqldb.server.Server --database.0 file:~/tmp/hsqldb/mojito --dbname.0 mojito
```

It should run on `9001`

```shell
[Server@506e1b77]: 2023-12-15 00:09:46.887 HSQLDB server 2.6.0 is online on port 9001
```

Then use following properties:

```properties
spring.datasource.url=jdbc:hsqldb:hsql://localhost:9001/mojito
spring.jpa.hibernate.ddl-auto=create
spring.jpa.defer-datasource-initialization=false
spring.sql.init.mode=always
spring.sql.init.data-locations=classpath:/db/hsql/data.sql
```

For quick plain SQL query debugging

```java

@Autowired JdbcTemplate jdbcTemplate;

jdbcTemplate.queryForList(
"select unix_timestamp(), unix_timestamp(mblob.created_date), current_timestamp, mblob.* from mblob ")
.forEach(System.out::println);
```


Loading