Conversión de DDL de Oracle o Sql Server a Derby

We have SQL Server/Oracle DDL but I'd like to use Derby for development/automated testing purposes. I want a test env that I can sync to from source control and just run - no DB install BS.

Does anyone know a good way to convert either SQL Server or Oracle DDL to Apache Derby?

preguntado el 31 de enero de 12 a las 16:01

You are aware that this does not make a lot of sense. DDL is different for each DB system. Testing on a different database system than used for production is pretty much a wasted effort. -

It makes all kinds of sense. We would still test on a production DB after it passes the initial tests against Derby. We have DB-agnostic code, it's just the DDL that is different (with a few exceptions). SQL Server/Oracle setup is onerous and time consuming, and very difficult to script. Derby is just a jar file. -

Locking and performance behavior for each of these DB's will be very different. Its actually not difficult to script. -

2 Respuestas

I don't know of an automated way to do it, but it shouldn't be too hard. If it were my, I'd just submit my SQL Server or Oracle DDL to a test Derby database and start looking at the errors.

Then I'd start writing a short program in my favorite scripting language to process the DDL and change the parts that Derby is complaining about to the syntax that Derby requires.

Respondido 01 Feb 12, 23:02

Echa un vistazo a Liquibase.

You can define your tables (and other DB objects) in a DBMS independent XML definition. Liquibase will then take care of creating the approriate DBMS-specific DDL for you.

If you need to target different DBMS with the same definition source, this is definitely something you should look at.

Respondido 02 Feb 12, 00:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.