Re: ApplicationName and WorkstationID
- From: Joe Weinstein <joeNOSPAM@xxxxxxx>
- Date: Mon, 18 Dec 2006 09:39:16 -0800
Wes Clark wrote:
In Java, how can I dynamically modify the applicationName property of the connection after the connection is established, and after I get it from the connection pool?
Hi. There is no standard JDBC call that is defined to set or
change the DBMS's idea of the application name. Some DBMSes
don't have any option to define a client name string. The
SQLServer login protocol allows for a 'program_name' field
to be sent, and will be reported as part of the output from
sp_who etc. If you look at the text for sp_who, it will show
that the system table sys_processes is storing the 'program_name'
value. The only way you could change the program_name for a
running connection would be an explicit update statement
such as "update master.dbo.sysprocesses set program_name = ...
where sp_id = <my_sp_id>". This would also require you to
configure your DBMS to allow ad-hoc updates to system tables...
HTH,
Joe Weinstein at BEA Systems
"DGA" wrote:
Wes Clark said (on or about) 12/17/2006 15:01:
I see how I can set the application name and workstation ID in the JDBC URL. I'd like to be able to supply information such as end user name and workstation ID dynamically to the connection I get from the connection pool. I'm pretty sure you can do this in .Net. Is there any way now, or planned, to extend the JDBC Connection class to support this?
The java.sql.Connection interface specification is part of the JDBC
specification. Modifications to the specification are handled via
the Java Community Process -- you can get all the details at:
http://java.sun.com/products/jdbc/download.html
If you have a need for a Java class that provides that functionality,
you might consider implementing your own WesConnection wrapper class
around whatever underlying Connection implementation you are using.
Or you can make it part of your application's code.
.
- References:
- Re: ApplicationName and WorkstationID
- From: DGA
- Re: ApplicationName and WorkstationID
- Prev by Date: Re: ApplicationName and WorkstationID
- Next by Date: Re: ApplicationName and WorkstationID
- Previous by thread: Re: ApplicationName and WorkstationID
- Next by thread: Re: ApplicationName and WorkstationID
- Index(es):
Relevant Pages
|
Loading