Skip to content
Advertisement

Tag: h2

After trying to test connection to h2 database or connect whitelabel error occurs

After running Spring boot project and going to localhost:8080/h2-console and after trying to connect to my database I get whitelabel error when i click any button on h2-console screen. I am using in memory database. I am trying to connect to database with classic username:sa and password:(blank) Even after clicking Save i get whitelabel error application properties: pom xml: configure

Java H2 Mixed mode (embedded and server) external connection

I am trying to convert my existing embedded H2 database and enable external connections to it. Currently my properties are For a local connection to my db in this mode I seem to be able to connect to “jdbc:h2:file:./db;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9090” through my intellej IDE. If this database is hosted on a external server how do i connect to it? I have

spring boot – displaying object data from controller in JSP

I have a User class, two JSP and one controller. I want to register a user, store their details in a database (H2) and display user’s name after registration. This is my home.jsp – This is my controller – This is my afterRegister.jsp – The object gets added to the database. What am I doing wrong when it comes to

Escape colon (‘:’) in custom h2 Query

So I am trying to write a custom query for h2 using its JSON_OBJECT function. JSON_OBJECT uses a format of JSON_OBJECT(key:value) so as a simple example in my Spring repository I am writing a query like @Query(value = “SELECT JSON_OBJECT(‘id’:1)”, nativeQuery = true) When executing that same query in the h2-console it operates as expected but in Spring the colon(‘:’)

How close possibility to add new data in H2?

I have a problem. After adding some data to database, I need to set read-only mode for whole DB. What is the easiest way to do that using h2 embedded DB with driver manager (jdbc)? Answer You can open the whole database in read-only mode by appending ;ACCESS_MODE_DATA=r to the JDBC URL (“jdbc:h2:” + “./” + dbName + “;ACCESS_MODE_DATA=r” in

Jooq Java CTE wrong render

I have CTE that is been creating from DSL.values: Then i am trying use it to get needed values from DB But i have only the next error I suppose it happens because of (select * from (values(cast(? as varchar)) How to fix it? Other methods without cte work fine. Answer The problem was there: “Id” is needed to be

Advertisement