Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

how to backup and restore database using java

Ads

 
 

Share on Google+Share on Google+

padmanaban
how to backup and restore database using java
1 Answer(s)      7 years ago
Posted in : Swing AWT
Ads
View Answers

December 8, 2009 at 2:27 PM


Hi Friend,

Try the following code:

import java.util.*;
import java.io.*;
public class BackUpSql {
public static void main(String[] args) {
try {
Runtime rt = Runtime.getRuntime();
rt.exec("cmd.exe /c start C:\\ab.bat");
System.exit(0);
}
catch(Exception ex){
ex.printStackTrace();
}
}
}

Here is the ab.bat:

set path=%path%;C:\Program files\MySQL\MySQL Server 5.0\bin;
mysqldump -uroot -proot register>C:\back.sql

where root is the username and password and register is the database.

For more information, visit the following link:

http://www.roseindia.net/mysql/mysql_backup_restore.shtml

Thanks

Ads









Related Tutorials/Questions & Answers:
how to backup and restore database using java - Swing AWT
how to backup and restore database using java  sir my project is to backup and restore my datas using java so i want to know how to backup and restore databases using java give ur ideas and suggestions to me immediately  
database backup and restore using java - JDBC
database backup and restore using java  Hi... I have MS Access 2000 database.I want to backup and restore the db using jdbc.What's the procedure for that. Thanks in advance
Advertisements
database backup and restore
database backup and restore  hi i m able to take backup through java code but i m unable to restore the same file through the restore code . please provide me some suggestion
how to take backup of phone to pc using java code
how to take backup of phone to pc using java code  i want to take the backup of phone data in my pc and also provide the restore functionality,and i want to do it using java program,so can anyone help me
In this section you will learn how to rename MySQL database.
into new database Take the backup of database using mysqldump utility... database using following command create database account2; and then restore...How to rename MySQL database? In this section we will learn the safest method
oracle database backup using jsp
oracle database backup using jsp   I want to take the backup... a backup of the database is stored in one of my local drives.Is it possible to do this task? If possible how can it be done
How to Restore The Lossed data in MYSQL database after the System is formatted
How to Restore The Lossed data in MYSQL database after the System is formatted  How to Restore The Lossed data in MYSQL database after the System is formatted
Backing Up and Restoring A MySQL Database
and Restoring A MySQL Database This tutorial explains the how to backup... hardware or software failures  backup data can be used to restore the Database... files Here is the video tutorial of: "How to backup and restore MySQL
Database backup
Database backup  I am developing c# application in which i am using Microsoft Access database (OLEdb connections). I want to take backup of database programaticaly. Or as i can tae it in sqlserver 2008 r2(.bak) file. How can i
Backing Up and Restoring A MySQL Database
the Database. Here is the video tutorial of: "How to backup and restore MySQL... Up and Restoring A MySQL Database This tutorial explains the how to backup and restore the MySQL Database. Databases are used to store large amount
how to take iphone backup using itunes
how to take iphone backup using itunes  Hi, Can anyone please tell me how to take iphone backup using itunes..?   You can find the details on apple website as well... anyhow i am giving you some tips as follow... How
how to backup files and folder with Java
how to backup files and folder with Java  Does anyone know to create a backup with java?. backup files and folders from my computer to an external...(originalFile.getCanonicalPath() + ".backup"); originalFile.renameTo
PHP mysql database backup script - PHP
PHP mysql database backup script  How can i get the database backup using PHP mysql database
MySQL restore function in java - JDBC
MySQL restore function in java  I would like to import to a database .sql file. It is possible with the use of mysql administrator, however I would like to do the same with the use of java.Is it possible?If yes, how to do
Backup MySQL Database - JSP-Servlet
Backup MySQL Database  Database Sir I have been reading Rose's india tutorial "Using MySQL Database with JSP/Servlet". In the Tutorial you have shown an example of backing up the database. When I tried to backup database
How to insert dynamic textbox values into database using Java?
How to insert dynamic textbox values into database using Java?  Hi I am trying to insert dynamic textbox values to database, my jsp form have 2... these dynamic textbox values to database(Oracle 11g)...Please help me out. I have
php backup database script - PHP
php backup database script  please post the backup database script in PHP. Thank u very much
Learn how to take MySQL Backups and restore the same.
Learn how to take and then restore the MySQL database backup. You can use mysqldump utility to take the backup of MySQL database and tables with or without.... Following example shows how to take MySQL backup
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  ... Database But i m still not able to open this picture through Java using M.S. Access and i wants to open this Picture On Web Browser using Java Servlet anybody can
How to Retrieve Data from the database and write into excel file using Java
How to Retrieve Data from the database and write into excel file using Java  Hi, I am trying to develop an small application where i trying to retrieve Data from the database and store the details in excel file. Please can
restore all mysql database:cPanel MYSQL 5.1 to 5.5
restore all mysql database:cPanel MYSQL 5.1 to 5.5  restore all mysql database:cPanel MYSQL 5.1 to 5.5
Java backup pst file
Java backup pst file  Hello!! i need some help please. Im new in Java. How can i create a java program to backup any files and folders (like PST files)in my computer at a specific time
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
How to export data from database to excel sheet by using java in standalone project
How to export data from database to excel sheet by using java in standalone project  How to export data from database to excel sheet by using java in standalone project
how to retrieve image from mysql database using java and show it in HTML img tag ?
how to retrieve image from mysql database using java and show it in HTML img tag ?  how to retrieve image from mysql database using java and show it in HTML img tag
how to take a backup of a table in sql
how to take a backup of a table in sql  how to take a backup of a table in sql?   SQL BackUp Table example
How to save database data into excelsheet using hibernate
How to save database data into excelsheet using hibernate  How to save database data into excelsheet using hibernate
how to connect to database in php using mysql
how to connect to database in php using mysql  how to connect to database in php using mysql
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java
How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java  How To Store... and then retrieve them in image gallery using java