db2 - Database Application Server connection association -


i having following idea investigate , find out if possible work. having db2 server in linux machine , 2 kinds of application servers, geronimo , websphere. know whether possible associate geronimo or websphere connection db2 agent. in other words, know user of web application running query @ database @ given moment. thank in advance,

you create 2 users, 1 geronimo, , 1 websphere, both users in same group. give privileges group, , both users have same privileges.

then, when issue 'list applications' discriminate connetions geronimo, , websphere.

if want change application name, there 2 approaches depending java connection.

class.forname

class.forname("com.ibm.db2.jcc.db2driver"); properties props = new properties(); props.put("user", "scott"); props.put("password", "tiger"); props.put("clientprogramname", "my program 1"); connection conn = drivermanager.getconnection( "jdbc:db2://localhost:50000/sample", props); 

datasource

connection conn = null; db2simpledatasource ds = new com.ibm.db2.jcc.db2simpledatasource(); ds.setdrivertype(4); ds.setservername("localhost"); ds.setportnumber(50000); ds.setdatabasename("sample"); ds.setuser("scott"); ds.setpassword("tiger"); ds.setclientprogramname("my application 2"); conn = ds.getconnection(); 

you assign conneciont name dynamically, retrieving application server name.

i wrote blog that: http://angocadb2.blogspot.fr/2012/12/nombre-de-la-conexion-java-en-db2-java.html


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -