If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Detect DB2 instance from Java program

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-10, 08:15
rahulkul rahulkul is offline
Registered User
 
Join Date: Sep 2009
Posts: 5
Detect DB2 instance from Java program

Hello DB2 users,

I have one query regarding DB2 and Java APIs. I am writing Java program to create DB2 database objects from configuration file. I am reading the database instance name. Now I need to check if it is present on the target machine, then do not create the instance. Else I have to create the instance using Java command. I know this is different type of command than JDBC commands like read/write/update tables.
Will you please let me know which java API can be used to execute command to detect DB2 database instance, and how to execute them?

Thanks for the help in advance.

rahulkul
Reply With Quote
  #2 (permalink)  
Old 04-12-10, 08:16
rahulkul rahulkul is offline
Registered User
 
Join Date: Sep 2009
Posts: 5
Associated doubt

With this one more associated problem is how to detect the space availability for the new database instance. How to detect if there is any problem with the space available at the target machine?

Please adivse.

Thanks,
rahulkul
Reply With Quote
  #3 (permalink)  
Old 04-12-10, 09:08
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Creating an instance is an OS command, so you cannot use JDBC at all. The command also has to be run on the server that the instance will be run on. It is a simple enough process. Why do you need to make a java app to do it?

Andy
Reply With Quote
  #4 (permalink)  
Old 04-12-10, 10:36
rahulkul rahulkul is offline
Registered User
 
Join Date: Sep 2009
Posts: 5
Java application for creating DB as well as many tables at one go!!

We need Java application to handle manual inputs. Also this will be useful to create all the database tables on the created database instance remotely.

Please advise.

Thanks,
rahulkul
Reply With Quote
  #5 (permalink)  
Old 04-12-10, 10:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
There is only 1 way I know to create an instance:

IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

As far as creating tables and such remotely, IBM supplies tools to do that (Control Center or Optim Database Admin tools)

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On