Question: I want to use HsqlDB or H2 to make tests with an in-memory database. I have databases in production with Oracle and postgreSQL. So I want to know if there are tools that allow converting an oracle, postgreSQL... database structure to a hSQLDB or H2 schema.

Thanks in advance

Answer: 
Have a look at [DdlUtils](http://db.apache.org/ddlutils/).

Quoted from that site

> 
> DdlUtils can generate a DDL file for an existing database.  
> 
>  These are XML files that contain the definition of a database schema, e.g. tables and columns.  
> 
>  These files can be fed into DdlUtils via its Ant task or programmatically  
> 
>  in order to create the corresponding database or alter it so that it corresponds to the DDL
> 
> 
> 

You might encounter difficulties in the first run, if the reverse engineering fails. Anyway, somehow you can manage to get a logical data model, and you can use this both for production and testing.
Just found out [RazorSQL](http://razorsql.com) can convert between PostgreSQL, Oracle and HSQL, but I couldn't get it to produce valid HSQLDB files from PostgreSQL..

Disclaimer: it's a commercial product with a 30day trial period, and I'm not affiliated in any way..