batch file - How can I run my java program as different windows user? -
scenario:
i have java program connect database. dbadmins
, give security must access ip
, db_user
, osuser
. these access. can connect toad db.
problem:
i cant connect java program use jdbc
connection.
java.sql.sqlexception: ora-00604: error occurred @ recursive sql level 1 ora-20099: my_db_user user'i osuseri ile myserver(10.210.yyy.xxx) host'undan db_host db'ye baglanamazsiniz. "thegroup" grubundan yetki talep ediniz... ora-06512: @ line 32
you can see osuser
has empty value. mean should filled. mean java program cant osuser
name think.
tried:
i open cmd test jar file , run cmd my_user(it allowed connect db can connect toad) , enter cmd. @ top of cmd screen says connect 'my_user' (it seems right)
and write java-jar my_program.jar
problem same, osuser
empty.
how can run jar file different user? or should need give grant user such can run batch file (i not know actually).
extra info
- i have server closed , same config , jar runs on server.
- if not have access db says error:
java.sql.sqlexception: ora-00604: error occurred @ recursive sql level 1 ora-20099: my_db_user user'i
my_userosuseri ile myserver(10.210.yyy.xxx) host'undan db_host db'ye baglanamazsiniz. "thegroup" grubundan yetki talep ediniz... ora-06512: @ line 32
mean can see says my_user osuser, field empty,
in connection prop. there
props.put("v$session.osuser", system.getproperty("user.name").tostring());
and checked comes true when debug why not see osuser name in error, i have grant ip,osuser,db user connect cant
update detect strange thing, : when pu jar same credentails connects db know should not or orher should connect, want know matter, in code level same why 1 program connect , other block ,
thanks
Comments
Post a Comment