1 Replies - 17738 Views - Last Post: 20 March 2012 - 02:35 AM

#1 AngelRaj   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 01-December 11

Is it possible to restore a database using java?

Posted 13 March 2012 - 10:22 PM

Hi all,

Is it possible to restore a mysql database using a .sql file? I dnt want to get the file, separate it using a separator and run it line by line. Is there an api, to accept the whole file and restore it with the existing database?

Can anyone please help me?
Is This A Good Question/Topic? 0
  • +

Replies To: Is it possible to restore a database using java?

#2 AngelRaj   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 01-December 11

Re: Is it possible to restore a database using java?

Posted 20 March 2012 - 02:35 AM

No way to do this?

I thnk I have to follow the same previous logic. get the file, separate it using a separator(; in my case). Then execute it line by line using executeUpdate command.

I have done the restoring by overiting on the same database which I used for connection. I have ignored the creation of new database by ignoring the create database and use sql commands in the sql script.

Is there any better way?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1