wood burning stoves 2.0*
The moose likes JDBC and the fly likes back up database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "back up database" Watch "back up database" New topic
Author

back up database

biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
hi,
Is it posible to take a back up of a database using jsp..
If possible how its possible.. Please help me to find a solution..

Regards

[ December 24, 2007: Message edited by: Bear Bibeault ]

Edited to remove e-mail. Please UseTheForumNotEmail/
[ December 24, 2007: Message edited by: Jeanne Boyarsky ]

Biny Balan
binypanackal@gmail.com
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Strictly speaking, no.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Please avoid posting in all uppercase. I fixed your subject for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
pleae help me to solve the problem
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

JSP is a technology for delivering dynamically created web pages to a browser. It's not something that can help you to back up a database. Sort of like trying to use a toothbrush to butter your bread.

I've moved this to the JDBC forum with a change of title.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

You could use Java (not only JSP) to backup the contents of your database, by extracting all data from all tables.

You can use DatabaseMetaData to retrieve all table names, then use "SELECT *" for all those tables. The returned ResultSet for each table has a method to retrieve the ResultSetMetaData that contains information on the column names and types. Iterate over the ResultSet, nested iterate over the columns (hint: use ResultSetMetaData.getColumnCount(), start at 1!), calling the appropriate getXXX() methods. You can use getString() to be safe.
Just keep one thing in mind: how will you handle NULL? As an empty string, or what?

All in all, I'd forget what I just said and look at the backup opportunities of your database system instead. They are almost always the best way.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: back up database
 
Similar Threads
Type 3 vs Type 4 Drivers
JSP program to insert,delete,and retrieve
Does anyone know how to use FCKeditor?
scjp 5 certification
Does anyone know how to use FCKeditor?