"Hassan Naqvi" <ha**********@gmail.com> wrote in message
news:5a**************************@posting.google.c om...
Hi,
Basically, I am Java developer. In past I have played with Oracle
using Java (JDBC). But this is the time to play with IBM DB2 using
Java (JDBC). So kindly help this DB2 newbie.
I have a file of 32 MB, named as "fdbk5.0". This is actually a
database created in DB2 and containing records. I am interested in
viewing the *structure of this database, i.e. table names, column
names and finally all the records. How I can do this? Which DB2
product/version I have to install to view this DB?
Also, it will be highly appreciated, if there is any good info/code
availaible on how to connect DB2 using JDBC API.
Platform: Windows XP and 2000
I am also a Java developer and I have written a number of Java programs that
operate against a DB2 database via JDBC.
Assuming that your file 'fdbk5.0' is a normal backup of a DB2 database, you
will need to restore it to a live DB2 database somewhere before you can
access it with Java. Do you know what version of DB2 took this backup?
Normally, you restore a database to a copy of DB2 that is at the same
version as when the backup was taken. Therefore, if you backup up a DB2 V6.0
database, you restore that backup to a DB2 V6.0 database.
It is usually possible to restore older databases to a newer version of DB2
but this can be quite involved since the record formats often change from
version to version; that means that an older database has to be converted,
sometimes repeatedly, to bring it up the version of DB2 that you are
running. Therefore, if your backup is from a DB2 V6.0 system and you want to
run it in DB2 V8.x, you will need to restore and convert it. (I don't recall
if you have to convert it from V6.0 to V7.x and then from V7.x to V8.x or if
you can convert it from V6.0 directly to V8.x.)
If you don't know what version of DB2 created your backup, there may be some
way to determine this from the 'fdbk5.0' file itself, although I don't know
how myself. I looked through one of my backups and didn't see an obvious
version number but it was a huge file and I could easily have missed it.
You should probably install a current version of DB2 for Windows, either
V8.1 or the new (beta) V8.2, and then attempt to restore your backup into
it. It probably won't work but the error messages should help you figure out
which version the backup is so that you can figure out which conversions
need to be done to make your restore successful.
When you have installed DB2, use the documentation provided to read about
:
- 'Migration' from previous versions of DB2.
- the Restore command
- Java application development. I think you'll find the Java sample programs
particularly useful for finding out how to connect to a DB2 database from a
Java program.
You can see the DB2 documentation for V8.2 online at
http://publib.boulder.ibm.com/infoce...help/index.jsp if you want to
read it before installing DB2.
Rhino