Home » Developer & Programmer » JDeveloper, Java & XML » Proxy user connectivity with thin driver (oracle 11g, Jdeveloper 10.1.3.3.0)
Proxy user connectivity with thin driver [message #465081] Mon, 12 July 2010 09:19 Go to next message
nadvi
Messages: 46
Registered: May 2006
Location: Canada
Member

Hi,

The database I'm working use proxy user authentication. When I select oci8 as driver I can connect using the below login method:

Host Name : username[proxy user]
password : password

but it shows as invalid username/password when I select the driver = THIN.

What could be the reason behind this?

The below doc says, proxy connectivity method is same both for THIN & OCI8 driver. But what I can see is Jdeveloper is somehow misinterpreting the proxy user name.
Ie, Username[Proxy user] and the reason why it throws invalid username/password.

http://download.oracle.com/docs/cd/E11882_01/java.112/e10589/proxya.htm#CHDHHAAD

But the same syntax works fine with sqlplus, or any other IDE.

Can anybody guide me on this.

Thanks

[Updated on: Mon, 12 July 2010 09:21]

Report message to a moderator

Re: Proxy user connectivity with thin driver [message #465086 is a reply to message #465081] Mon, 12 July 2010 10:07 Go to previous messageGo to next message
Michel Cadot
Messages: 58643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This syntax is specific to tools that translate it to driver call.
An example of code to use proxy authentication is the following one:
    try {
      Properties props = new Properties();
      props.put("user",     user);
      props.put("password", password);
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
      // Open standard connection
      OracleConnection con = (OracleConnection)
        DriverManager.getConnection("jdbc:oracle:oci8:@"+url,props); // also works with thin
      ResultSet rst = con.createStatement().executeQuery ("select user from dual");
      while (rst.next()) {
        System.out.println ("Standard connection: user=" + rst.getString(1));
      }
      rst.close();
      // Open proxy connection
      props.put(OracleConnection.PROXY_USER_NAME,     proxyUs);
      props.put(OracleConnection.PROXY_USER_PASSWORD, proxyPsw);
      con.openProxySession (OracleConnection.PROXYTYPE_USER_NAME, props);
      rst = con.createStatement().executeQuery ("select user from dual");
      while (rst.next()) {
        System.out.println ("Proxy connection: user=" + rst.getString(1));
      }
      con.close();
    }

Regards
Michel
Re: Proxy user connectivity with thin driver [message #465093 is a reply to message #465086] Mon, 12 July 2010 10:30 Go to previous messageGo to next message
nadvi
Messages: 46
Registered: May 2006
Location: Canada
Member

Hi Michel,

I'm new on this. I was trying to login on Oracle JDeveloper using the proxy connectivity syntax. Do I need to put your delivered code somewhere inside JDeveloper?

I was trying with creating Database connection selecting THIN as driver and failed.


Thanks.

[Updated on: Mon, 12 July 2010 10:37]

Report message to a moderator

Re: Proxy user connectivity with thin driver [message #465098 is a reply to message #465093] Mon, 12 July 2010 10:50 Go to previous messageGo to next message
Michel Cadot
Messages: 58643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sorry I don't use JDevelopper, it is Java (JDBC) code to connect with a proxy user, I don't know how you can do it with Jdeveloper.

Regards
Michel
Re: Proxy user connectivity with thin driver [message #465099 is a reply to message #465098] Mon, 12 July 2010 10:53 Go to previous message
Michel Cadot
Messages: 58643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It seems you can't natively use proxy authentication, see:
http://download.oracle.com/docs/cd/E14571_01/web.1111/b32441/dblgcfg.htm#JITDG10119

But it also seems there is an extension to allow it:
http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/proxy/index.html

Regards
Michel

Previous Topic: Combine Date Field to other fields
Next Topic: paging in pl/sql with xml format.
Goto Forum:
  


Current Time: Fri Aug 01 20:50:26 CDT 2014

Total time taken to generate the page: 0.06229 seconds