h2

H2 console access for databases other than h2

H2 console (http://localhost:8082/login.jsp) has the option to look at details of any database, where should we copy the jdbc driver if we have tp talk to the mysql or other database servers. Copying the jdbc driver file (mysql-connector-java-5.0.8-bin.jar) under bin directory didn't seem to help Note: My H2 server is running as a servi...

How in H2DB get sql dump like in MySql?

Hello all! I have some questions about H2DB. I have H2DB database which stores data in files, I have 3 files test.18.log.db, test.data.db, test.index.db. I want get sql dump file like when I use mysqldump. It's possible? Thanx all! ...

H2 database: clustered indexes support

I use H2 database for environmental data which contains lots of time series. Time series are simply measurement values of sensors which are recorded in database periodically (say once per hour). The data stored in the table: CREATE TABLE hydr (dt timestamp ,value double ,sensorid int) I would like to make range queries against the t...

create if not exists view ?

HI all, Is there any way of create view if not exists in sql on mysql db or h2 db. ...

H2 Database vs SQLite on Android

Because of the lack of Unicode support on the embedded SQLite database in Android I am mostly interested in performance and stability of H2 Database vs Android SQLite Are you guys using it? Should I be aware of any H2 database shortcomings? ...

How can I get H2 to work with Spring?

I am writing a test which extends Spring's AbstractTransactionalJUnit4SpringContextTests. In my application code I have a method which I call inside the test annotated by the following: @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) Problem I run into a problem while using H2 as the underlying data source ...

Create an in-memory database structure from an Oracle instance

Hello, I have an application where many "unit" tests use a real connection to an Oracle database during their execution. As you can imagine, these tests take too much time to be executed, as they need to initialize some Spring contexts, and communicate to the Oracle instance. In addition to that, we have to manage complex mechanisms, s...

H2 database: Information about primary key in INFORMATION_SCHEMA

I create the following table in H2: CREATE TABLE TEST (ID BIGINT NOT NULL PRIMARY KEY) Then I look into INFORMATION_SCHEMA.TABLES table: SELECT SQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TEST' Result: CREATE CACHED TABLE TEST( ID BIGINT NOT NULL ) Then I look into INFORMATION_SCHEMA.CONSTRAINTS table: SELECT SQ...

H2 datastore EXTREMELY slow!!!

I just tested the H2 datastore (with Datanucleus 2.x) The performance is VERY slow. 1/3 of Postgres and 1/10 of MySQL (aprox.) I was very pleased by the "specs" but i cannot see them in "real usage". http://www.h2database.com/html/performance.html Is there any performance tuning that i might be missing? NOTE: even when accessing "our...

how can I provide a relative path for H2 database file, using hibernate under Tomcat?

Greetings, I have a setup which must be fairly common: I have an H2 db, with a db file. I'm using the db in standalone mode. Hibernate provides access to db, and I've deployed my code into Tomcat. The problem is: I could not find a nice way of simply putting the db file into the war, and providing a relative path in hibernate config fil...

H2 Database error message localization

I have a problems with H2 Database exception messages. The language of the messages corresponds to the OS language(I'm using Windows). Is it possible to turn off localization feature to get messages only on English? ...

JPA/Hibernate support for migration?

Aloha, I'm currently working on a desktop application using JPA/Hibernate to persist data in a H2 database. I'm curious what my options are if I need to make changes to the database schema in the future for some reason. Maybe I'll have to introduce new entities, remove them or just change the types of properties in an entity. Is there...

H2 database: What is and why appears database.xx.log.db.corrupt binary file

I am extensively using H2 database for my project (lots of inserts and selects) and I have noticed that in the database directory appear binary files which have the name: database.xx.log.db.corrupt, where xx - a number. Does anybody know if there are possibility to understand what this file stands for and why it appears? ...

java ClassNotFoundException for org.h2.Driver

I am trying to use H2 to connect to a database in Java (using Eclipse as the IDE). The sample does (below) throws a ClassNotFoundException. The thing is, I did add the h2 jar file to the system CLASSPATH. I have even checked it's there several times via 'printenv' in the console. Am I omitting a step? CODE: import java.sql.*; public c...

Deleting a member from a ManyToMany collection throws org.h2.jdbc.JdbcBatchUpdateException

public class Group{ @ManyToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL, mappedBy="groups") public Set<User> getUsers() { if(users == null) return new HashSet<User>(); else return users; } public void setUsers(Set<User> users) { this.users = users; } } public class User{ public void setGroups(Set<Group> groups)...