0

Is it possible to take the backup of mysql database using hibernate ? Share your ideas. I am using hibernate mapping xml for pojo mapping with table.

Md Ismail
  • 159
  • 1
  • 6

3 Answers3

1

AFAIK, Hibernate not providing features for backup or restore.

How ever you should consider to do it from command line, which you can execute through java.

Downloading MySQL dump from command line

Community
  • 1
  • 1
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
0

Hibernate does not provide database backup functionality and here is why,

  • Hibernate is an OR mapping tool and primarily aimed as objectifying the database so that the code developers don't have to bother about databases interaction intricacies and never have to work with database directly.

  • Database backups are taken by DB administrators (and not developers) who very closely work with the databases and are familiar with tools and terminologies. Hence tools like hibernate do not have any role here to play.

Santosh
  • 17,667
  • 4
  • 54
  • 79
  • your point is acceptable. but if we develop application like console for DB admin to simplify their work and if we are using hibernate in that application, we may need this functionality rite. It is just my thought. Any how thanks for your information – Md Ismail Oct 09 '13 at 11:35
  • In that case to, using Hibernate may not be a wise idea. For an application like DB admin console, the internal mysql command would be faster and efficient. – Santosh Oct 09 '13 at 11:41
0

Here follows some solutions

  1. You can create hibernate with ant for restore/backup database This Link provide more information about that
  2. Here follows another solution for backup/restore tables programatically using hibernate
Anish Antony
  • 875
  • 3
  • 17
  • 35