473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Testing for a Connection

Hello All,

After searching google groups and the web, there seems to be no good answer
to this but I thought I would ask anyway.

Is there a way to programmatically test for a db2 connection, similar to
'db2 get connection status'?

I can not even seem to programmatically direct the output of that command to
a file. Any ideas?

Thanks.

-g
Oct 19 '06 #1
3 1508
Geoff wrote:
Hello All,

After searching google groups and the web, there seems to be no good
answer to this but I thought I would ask anyway.

Is there a way to programmatically test for a db2 connection, similar to
'db2 get connection status'?
You could issue a simple SQL query like:

VALUES (1)

to test if a connection exists.
I can not even seem to programmatically direct the output of that command
to a file. Any ideas?
I would simply use pipes - assuming that you have C code.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Oct 19 '06 #2
I like that except we have several type 2 connections running at the same
time. When a connect is issued multiple times, programmatically, eventually
the process has problems creating threads. There is plenty of memory left
and the error is, 'can not start thread'.

I was looking for some other way to test if a live db is there before
actually trying to connect.

-g
Oct 19 '06 #3
Geoff wrote:
I was looking for some other way to test if a live db is there before
actually trying to connect.
Unless you explicitly activate the database using the ACTIVATE DATABASE
command, the DB is not active if no connection (from any client) exists.
Hence, I'm not sure what kind of information you really want to have.
Maybe you want to know if the DB2 instance is started? Or is it really
DB-specific what you want to know?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Oct 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lee Mundie | last post by:
Hi, I'm nearing the end of my site development (currently ASP and Access moving to SQL) and am looking for site testing tools... In particular looking for load testing and concurrent connection...
8
by: Jozef | last post by:
Hello, Is there a way to test that an internet connection exists and that you are able to see the webserver before performing any connections? The reason being, when I try to connect to an SQL...
4
by: Scott B | last post by:
Can someone perhaps give me some insight as to why I am getting an OleDbexception when I try to run the following code. What I am looking to do is test if the connection could be opened and if...
2
by: Naveen Mukkelli | last post by:
Hi, I'm writing a client/server application using C#. The server accepts connecitons asynchronously, using BeginAccept/EndAccept. Is there any way we can write some unit tests(NUnit) to test...
0
by: John Hoge | last post by:
I'm testing VWD, which has some great features over VS.NET2003, but there is one feature that it seems to lack: I want to do my development and testing on a local testing server. Dreamweaver...
2
by: Justin | last post by:
I already got the data back from the database (so I am not worried about database related performance testing at this point) and there is a couple of different ways to process the data and I want...
6
by: =?Utf-8?B?QnNtZW5nZW4=?= | last post by:
I am trying to make sure that the local connection is up. I have presently been using the NetworkChange.NetworkAvailabilityChanged Event for this. Is there a better way to do this? Also, I...
11
by: Alexnb | last post by:
Hello internet. I am wondering, is there a simple way to test for Internet connection? If not, what is the hard way :p -- View this message in context:...
3
by: Alexnb | last post by:
Okay, I already made this post, but it kinda got lost. So anyway I need to figure out how to test if the user is able to connect to a specific website. Last time I got pointed to the urllib2 page,...
0
by: Alexnb | last post by:
Timothy Grant wrote: well I can tel you it didn't work for me. In fact I didn't see the code you posted on there, I ended up figuring it out on my own with a little help from the missing manual...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.