Re: ApplicationName and WorkstationID
- From: DGA <XXXdalbertsonYYY@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Dec 2006 22:27:10 -0500
Wes Clark said (on or about) 12/18/2006 10:36:
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?
something like
public class MyConnection implements Connection{
private Connection myConn = null;
private String applicationName;
public MyConnection ( String driverClassName, String login){
// construct myConn using driverClassName, login, etc
}
public void setApplicationName(String appName){
applicationName = appName;
}
//=== implement all the methods of the Connection interface
// by passing them down to myConn
}
You would also need to implement the special methods to use the application name.
Then in your application you can have
Connection appConn = new MyConnection(params...);
And use appConn just as you would any other implementation of the
Connection interface
"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: JBOSS 4.0.2 DataSources with SQLSERVER 2005 JDBC v1.1 Driver
- Previous by thread: Re: ApplicationName and WorkstationID
- Next by thread: Re: JBOSS 4.0.2 DataSources with SQLSERVER 2005 JDBC v1.1 Driver
- Index(es):
Relevant Pages
|
Loading