5 Replies Latest reply: Jan 6, 2010 11:08 PM by 699554 RSS

    How restor mysql database using a java

    807580
      how to restore mysql database "backup.sql" file using a java code.
        • 1. Re: How restor mysql database using a java
          Darryl Burke
          Don't double post and don't use the browser's back button to edit your posts as this creates multiple posts.

          I've removed the other thread you started.

          db
          • 2. Re: How restor mysql database using a java
            699554
            ssanjeewa wrote:
            how to restore mysql database "backup.sql" file using a java code.
            Many ways, is your question related to the appropriate query to execute or how to interact with a Database. If the later then refer to JDBC, otherwise you are asking a MySQL query in a Java forum.

            You can execute an internal query if I remember correctly called "load".
            Otherwise you can execute an external query from a shell such as CP: mysql -h host -u username -ppassword databasename < filename.sql

            Mel
            • 3. Re: How restor mysql database using a java
              807580
              ok thanks
              • 4. Re: How restor mysql database using a java
                807580
                Many ways, is your question related to the appropriate query to execute or how to interact with a Database. If the later then refer to JDBC, otherwise you are asking a MySQL query in a Java forum.
                
                You can execute an internal query if I remember correctly called "load".
                Otherwise you can execute an external query from a shell such as CP: mysql -h host -u username -ppassword databasename < filename.sql
                
                Mel 
                how to execute this code using java. i want to java code
                • 5. Re: How restor mysql database using a java
                  699554
                  ssanjeewa wrote:
                  how to execute this code using java. i want to java code
                  Research into JDBC (Java Database Connectivity) to learn how to connect to a Database using Java. Then Google for the internal query to execute a LOAD statement to replace the specified tables/databases using the backup file.

                  Alternatively you could execute a command using Java to the command prompt, utilizing an external MySQL command. However this is a tacky, limited workaround from my previous experience.

                  Mel