Connect to Oracle without username or password

Oracle has this concept, allowing database users to be identified by the user of the operating system that runs the program that connects to Oracle. See here .

This allows you, for example, to use this user on a unix machine, for example:

sqlplus /

I am trying to write a Java program for Oracle 10.2 that connects without a username or password. Obvious choice of url:

jdbc:oracle:thin:/@localhost:1521:MYDBSID

doesn't work giving an error (Sorry, I don't have an available error right now).

I tried to do so many others, but no luck.

Does anyone have any suggestions on how I can connect a Java program to Oracle using the OS authentication method?

+5
8

JDBC Thin - 100% - Java, .

JDBC OCI ! jdbc:oracle:oci8:/@MYDBSID, , Oracle , , ( , ).

+5

jdbc, oracle, URL-, . , JDBC ORACLE, , . google .

+1

Oracle J2EE, , JNDI .

0

11g Kerberos.

. Oracle Kerberos

0

JDBC: : : / @: 1521: MYDBSID

sqlplus/as sysdba unix-,

0

JDBC ​​ 11g ( JDBC 11.2.0.4 OTN).

, ( TCP), sqlplus, IPC BEQ . init.ora :

REMOTE_OS_AUTHENT = TRUE

, "osuserdemo" , , , :

 CREATE USER OSUSERDEMO IDENTIFIED EXTERNALLY;
 GRANT CONNECT,CREATE SESSION,RESOURCE TO OSUSERDEMO; 

And the thin JDBC driver should be able to connect without any username or password.

It is worth noting that this feature, considered extremely insecure, was canceled in 12c.

0
source

jdbc:oracle:oci:@ works with ojdbc6.jar and Oracle 11g2

-1
source

All Articles