Update a backend database on software update with Java


With which tool / library it is possible to update an existing database structure. On the update of the software it is also needed to change the database. Because there can be different versions of the software it should compare the current status with the target status of the database. It should:

  • add table columns, fill it with default values.
  • delete table columns
  • change the data type of columns, for example varchar(30) --> varchar(40)
  • add / remove indexes
  • add / alter / delete views
  • update some data in the tables
  • ...

It should support the DBMS:

  • MS SQL Server 2000 - 2008
  • Oracle Server 8 - 11
  • MySQL

Because our software setup and application run in Java that it must also be run in Java. What can we use?

Ideally it scan our development and save it in an XML file. Then we can add some data modification SQL command. Then it can be run on customer side with the setup of the update.

By : Horcrux7


Check out Liquibase. A database migrations tool, like dbmigrate, might also be worth a lok.

Autopatch is what we are using. It works pretty well.

It allows sql patches, data patches, and java patches all applied to your sql database.

By : ScArcher2

I think the most important question is, "Why are you doing it (the CMS, not the web site)?" This is very well-trod ground. Unless you have some really innovative ideas and unique insights into how you want it to be done ... and your question suggests that you probably don't ... you would probably be better-served by choosing an existing solution.

By : user19113

This video can help you solving your question :)
By: admin