Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

back up database

 
biny panackal
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strictly speaking, no.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please avoid posting in all uppercase. I fixed your subject for you.
 
biny panackal
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pleae help me to solve the problem
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic