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 > Visual Studio DB2 Connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-05-07, 19:59
koncept koncept is offline
Registered User
 
Join Date: Jul 2006
Posts: 26
Visual Studio DB2 Connection

Hello,

I've been trying to open a connection to a db2 server in visual studio to do a test if it is accepting connections. I cannot get my connection string to work (assuming i have the information right)

"Database=DB2D;UserID=368;Password=pass;Server=130 .101.19.39"
i am using this with the ibm db2 runtime client. I have tried some stuff with the oledb too with no success as well.

I will be talking with our database people tomorrow to see if i have the information correct but in the mean time i want to know the i got the connection string right. also is there a port option?

Thanks guys
Reply With Quote
  #2 (permalink)  
Old 05-06-07, 03:09
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
maybe this can help - have a look
http://www.databasejournal.com/featu...le.php/3622026
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 05-06-07, 09:50
koncept koncept is offline
Registered User
 
Join Date: Jul 2006
Posts: 26
thanks, but i need to do it programatically because the user that this program will be running with will only have connect privileges and this program will be running as a service so i want it to use as few resources as possible. it will not be able to do anything else. i dont really care if i can accesses tables we just need to know that we can successfully open connections to db2.
Reply With Quote
  #4 (permalink)  
Old 05-06-07, 10:51
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by koncept
"Database=DB2D;UserID=368;Password=pass;Server=130 .101.19.39"
i am using this with the ibm db2 runtime client. I have tried some stuff with the oledb too with no success as well.
The runtime client is a type 2 driver. Are you wanting to use the DB2 type 4 universal connection? If so, you will need the appropriate DB2 jars.

With the type 2 driver, you need to catalog the databases on the client. Withe a type 4 connection, you need to specify the DB2 instance port number somewhere in the connection string.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 05-06-07, 10:59
koncept koncept is offline
Registered User
 
Join Date: Jul 2006
Posts: 26
i am brand new to db2 but i am familiar with mysql & mssql. from what you have said it sounds like i want a type 4 connection.

all i want to do is if ping is good to db server then telnet/open a socket connection to db2 port, if good ping db2 connect server if good open a connection to db2 db. if not good alert admins and change the web page on our csm (that part i will take care of).
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