All Questions
Tagged with h2 spring-mvc
57
questions
10votes
4answers
4kviews
Store pictures in H2 database spring boot thymleaf
Good day. I want to store an image in an h2 database, then retrieve and display the same image in an html page. I am using spring boot and file upload method, but I am getting errors in the binding ...
6votes
3answers
3kviews
Executing H2 under Spring Boot
I've generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.
Technologies used:
Spring Boot 1.4.2.RELEASE,...
6votes
1answer
9kviews
H2 DB in Spring Boot Hibernate does not generate Db Schema
I want my Spring Application to autogenerate the DB schema and tables...
I've read some Q&A to this topic and I've set my DB URL to:
H2DataSource.setUrl("jdbc:h2:mem:tmp.db;INIT=CREATE SCHEMA ...
5votes
1answer
8kviews
Spring - CrudRepository is not created
The CrudRepository bean
@Repository
public interface UserDao extends CrudRepository<User, Long>
{
List<User> findByFirstNameAndLastName(String firstName, String lastName);
}
for the ...
5votes
1answer
8kviews
Spring + Hibernate + H2 Embedded DB. How is the data saved?
Im new to embedded databases but I got it running at least. What confuses me is that my data is not saved between runs. I mean wouldn't that be nice for testing? I don't wanna add data to my database ...
4votes
3answers
9kviews
H2 in memory database doesn't show tables created in spring boot
i have H2 in memory database configured with spring boot in maven multi module environment.
Spring boot log says Schema export complete,i couldn't see any table getting created in h2 database.
...
3votes
1answer
3kviews
H2 database c3p0 proxy with hibernate. Could not load driverClass org.h2.Drive
I'm working on my project Spring MVC, Hibernate and H2 Database. Before I moved from MySQL to H2 everything was working perfectly fine on MySQL. After so of the changes from MySQL to H2 database I ...
3votes
2answers
3kviews
runscript executed multiple times for @Autowired jdbcTemplate and h2 in-memory database
I've inherited a project and am trying to get a set of integration tests running against an in-memory h2 database. In order for them to pass some tables, relationships and reference data needs ...
3votes
2answers
4kviews
Spring test with H2 in memory database truncate all tables
I'm a junior CS major student working on an MVC project using spring and I am quite new to spring.
I set up an H2 in memory db and wrote 2 sql scripts; one to populate the db and another one to ...
3votes
1answer
1kviews
Using Spring to connect to a database that dynamically changes
I have seen many solutions which all make you first configure statically via XML the different datasources and then use AbstractRoutingDataSource to return back a key which you consume while defining ...
2votes
4answers
33kviews
Consider defining a bean named 'entityManagerFactory' in your configuration-Spring boot
following is my code
Spring boot Entry class
@SpringBootApplication
@EnableJpaRepositories("com.test.assertmanagementdigital4.repositories")
@EnableAutoConfiguration(exclude = {...
2votes
1answer
6kviews
How to connect H2 console to embedded Spring H2 DB
Ok, Im developing simple app, which has Spring Ebedded H2 database for development. database.xml bean conf looks like this:
<bean id="h2Server" class="org.h2.tools.Server" factory-method="...
2votes
2answers
368views
QuerySyntaxException with enum
I have a UserAssignmentRole class like this :
@Data
@Entity
public class UserAssignmentRole {
...
@Enumerated(EnumType.STRING)
public Role role;
}
And the Role is enum, it looks like ...
2votes
2answers
2kviews
Webservice calls within the same JDBC transaction are causing DB lock timeouts
I'm using the H2 database embedded within a Spring-MVC app.
I have declare Transactions at my service level. In particular I have a case where we do the folllowing:
Start a transaction
Make a ...
2votes
1answer
1kviews
Spring Boot with MVC application using H2 database
I am pretty new using embedded databases, and using Spring MVC also. I have made spring boot applications and used h2 database but in separate projects, and I am having trouble putting the two ...