-
1. Re: How to configure oracle ds in jboss to support os user
erasmomarciano Jan 14, 2010 9:13 AM (in response to pawfaf)Have a look on this url http://community.jboss.org/wiki/SetupAOracleDataSource
What's your problem?
Could you tell me the oracle and jboss versions?
-
2. Re: How to configure oracle ds in jboss to support os user
adrian.brock Jan 14, 2010 9:46 AM (in response to pawfaf)The user that started jboss is in a standard java system property, so something like:
<user-name>${user.name}</user-name>
If you want to do something more complicated, then the same answer as I gave here:
-
3. Re: How to configure oracle ds in jboss to support os user
erasmomarciano Jan 14, 2010 9:54 AM (in response to adrian.brock)The value of this tag
<user-name>${user.name}</user-name>
shuold be the user for the connection to the database
-
4. Re: How to configure oracle ds in jboss to support os user
pawfaf Jan 15, 2010 1:45 AM (in response to erasmomarciano)Oracle version is 11g
JBoss: 5.1.0
Yes I've looked at this setup of oracle data source link but there is nothing about mapping os user to db user.
The problem is that I don't know how to force JBoss to connect to Oracle DB as an example osuser.
What I've done for now:
I created user named osuser as Windows user (my Machine name is OS)
I created account in db: OS\OSUSER identified externally.
I login to the system as this user and when I am using "sqlplus /" i can connect to db.
But I don't know how to configure data source in JBoss that would use this osuser to connect to DB.
-
5. Re: How to configure oracle ds in jboss to support os user
jaikiran Jan 15, 2010 2:02 AM (in response to pawfaf)Did you try Adrian's suggestion (which is applicable for simple scenarios)?
-
6. Re: How to configure oracle ds in jboss to support os user
adrian.brock Jan 15, 2010 2:37 AM (in response to pawfaf)I understand what you're talking about now. It's not really a JBoss question.
You need to read the docs to find out what url and/or properties you have to configure for your jdbc driver.
A simple google search "oracle.com os authentication jdbc" found this as the first link:
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/clntsec.htm#CIHCBCBC
which is for Oracle's 11g1 thin driver.
However, the second link has a slightly different format for the url
http://forums.oracle.com/forums/thread.jspa?threadID=775813&tstart=30#2987394
but that's for 10g OCI and also hints at extra config for remote usage.
Anyway, in neither example is a user/password property specified.
So you probably need to remove the <user-name/> and <password/> xml elements from the jboss -ds.xml to get it to work?
i.e. you want them to be null, not the empty string.
-
7. Re: How to configure oracle ds in jboss to support os user
pawfaf Jan 15, 2010 3:03 AM (in response to adrian.brock)Yes I saw this article (your 1 link) and I wrote simple java code to check this and it works fine.
(There is one strange thing - you don't need to be logged as the user you want to connect to DB, you can use e.g. -Duser.name=osuser when execute java code and this also works, so if you know username than you can connect to DB - it looks like security issue).
And yes I've tried to remove <user-name/> and <password/> from ...ds.xml in JBoss but this doesn't work.
I've also tried to add -Duser.name=... parameter to run.bat in JBoss bin but this doesn't change anything.
-
8. Re: How to configure oracle ds in jboss to support os user
adrian.brock Jan 15, 2010 6:17 AM (in response to pawfaf)You tried your simple java code from the same machine as where jboss is running, with the same user?
Have you tried it from inside jboss, e.g. a simple jsp page?
The only thing I can suggest is to:
Enable TRACE logging for org.jboss.resource.adapter.jdbc
Then we can confirm what properties and url it is actually passing to Oracle.
You should see something in the LocalManagedConnectionFactory that looks like:
Using properties: []
Checking driver for url: jdbc:oracle:thin:@dbs1:1521:dbname
That is what it will pass to createConnection(url, properties).
NOTE: It will only print the url the first time it creates a connection.