Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java and DB2

Status
Not open for further replies.

Hattusas

Programmer
Nov 11, 2001
344
0
0
TR
Greetings.
In my applications I am planning to use both connection pool (provided by the Web Service) or the connection I will construct.
My database will be IBM DB2 and my question is somehow concerned but with java and DB2. When I succesfully establish a db connection How can I get the Application ID of that connection from DB2 into my java application?
If I can achieve this, I may be able to force
(kill) my desired application by entering
- force application <Application ID> from db2 console or java platform itself.
Otherwise I am unable to find which one of the modules crash my database although I know the application ID of that db connection.

Thanks.

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
What do you mean by "Application ID" ?
JDBC connections are just TCP/IP connections speaking a specific db protocol ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
When you get a connection from DB2, DB2 gives that connection an Application ID. I need that "Application ID" in my java applications.My modules do establish a jdbc connection successfully but what I need is; I want to know "which connection" goes to "which one of my applications".That is the problem.
If one of modules block the database,I can find out the Application ID number from DB2 Control Center of which causes a problem.But I can't know which java module uses that connection at the moment.

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
Hattusas,
that is excactly my problem, too.

To explain in detail:
My java application is running under application server (e.g. IBM WebSphere Application Server) and application connects to IBM DB2 database.

On DB2 database I can see 'application ID' and the name of application. Java applications running from windows environment I see application name 'java.exe' and java applications running from unix environment I see application name 'java'. But I don't know which java application is it. Is there any way to find out which application si running under application name 'java'?

Thanks,
Grofaty
 
Yes. That is the tricky question. Once I tried to use DB2 Connection but couldn't find a clue there.


Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
I don't follow you. I'm used to Java, DB2 and WAS and I've never heard or needed application IDs. What do you need them for? In which side?

Cheers,
Dian
 
There could be many situations for that. For example you run an ERP project that has various modules with many users.
One of the user calls a report but that report contructs a very severe SQL and allocates many resources. That allocation reduces the performance of the current transaction of the other users.
You try to solve the problem and when you at the applications part in DB2 command center, you may meet many connections in Lock wait state, or executing state so on. You have to kill that connection running that severe SQL.
How will you manage that?(In those situations getting a snapshot is the solution.But sometimes it takes a very long time to solve it).When it takes a long time you have the risk of getting angry telephone calls from the other users.

Secondly I think for constructing a well build software,you should be able control your connection within your programme. That is very helpful in solving the critical time against problems.

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
Well its certainly not a feature of standard JDBC - I think you would have more luck putting in a support call to your db vendor.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I agree, this has more to do with db monitoring than Java itself. To be sincere, I'd expect my Java application to have no idea of where it's connecting to, it's a portability use.

Maybe some TCP monitoring would get it resolved.

Cheers,
Dian
 
DB2 distinguishes that.. That is the Application ID. But we can't distinguish that from Websphere Enviroment - I mean from the programme side.That is the problem [peace] :)))))...

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top