Skip to content
Advertisement

Tag: database

H2 DB Incorrect special characters sorting

I’m trying to sort column data in my h2 database, but it isn’t correct. I think that change of collation may help. I tried to set collation in datasource url in many ways e.g.: spring.datasource.url = jdbc:h2:mem:testdb;COLLATION=’ENGLISH’ spring.datasource.url = jdbc:h2:mem:testdb;SET COLLATION=’EN” spring.datasource.url = jdbc:h2:mem:testdb;SET COLLATION ENGLISH STRENGTH PRIMARY’ And I’m still have an syntax error like this Syntax error in

Using 0 as Primary Key

I use lookup tables commonly and sometimes I have some default record in the Lookup table and I think for this record I can use 0 as Primary Key a as shown below: Project: By doing this I can start from 1 for the actual project values (A, B, C…) and on the other hand I can easily distinguish general/default

JOOQ: How to resolve foreign keys as objects?

Say I have a table that references another table, in this case “TestScenarios” references “TestSchemas”. So each TestScenario HAS-A TestSchema. I autogenerated DAOs, however, when fetching TestScenario instance via the DAO the TestSchema field is an integer, not a TestSchema-object. How can I get JOOQ to resolve foreign keys directly as objects up to a certain depth? Answer DAOs don’t

Constructor in a for loop

I’ve a beginner at java programming and I’ve been tasked at creating a database. The database is a bike store with a super class Bike and sub classes mountain bike, road bike. I also have a class …

Oracle 19c compatibility with jdk7

I would like to know if oracle 19c is compatible with jdk 7. I have found out 2 drivers for oracle 19c ojdbc8 : for jdk8, jdk9 and jdk11 ojdbc10 : for jdk10 and jdk11 I would like to know if there is a way to have oracle 19c with a jdk7, and if yes what is the driver that

HQL Join with three tables

I’m having some issues with HQL since I’m a newbie with it. Even though I don’t have issues with “simple queries”, I am currently stuck with a query involving three tables. I have already gone through some tutorials, but I haven’t been able to find a valid example for my needs. I have tried my best to explain my problem:

How you create confirmation link for email?

In my project I need to send letter to user email with confirmation link. My solution: Add string column “code” and boolean column “is_active” (with default value false) to user table. When user register, generate unique string key and save to database. Send to email link, for example host.com/user/email/{code}/confirm Then find by the code (generated string value) user and set

Advertisement