How do I use OS Authentication with WebLogic jDriver for Oracle and Connection Pools?

Submitted by: Administrator
Using OS authentication in connection pools essentially means that you are using the UserId of the user who started WebLogic Server. OS authentication is available on NT and UNIX, but not on Solaris. This means that database security will rely strictly on the security of WebLogic; that is, if you are allowed to make a client connection to the WebLogic Server and access the pool, then you can get to the database.

You can do this with WebLogic jDriver for Oracle because Oracle uses the process owner to determine who is attempting the connection. In the case of WebLogic JDBC, this is always the user that started the WebLogic Server.

To set up your Oracle instance to use this feature, your DBA needs to follow these basic steps. The full procedure is described in more detail in your Oracle documentation.

1. Add the following line to the INIT[sid].ORA file:
OS_AUTHENT_PREFIX = OPS$
Note that the string "OPS$" is arbitrary and up to the DBA.
2. Log in to the Oracle server as SYSTEM.
3. Create a user named OPS$userid, where userid is some operating system login ID. This user should be granted the standard privileges (for example, CONNECT and RESOURCE).
4. Once the userid is set up, you can connect with WebLogic jDriver for Oracle by specifying "/" as the username property and "" as the password property. Here is an example for testing this connection with the dbping utility:

$ java utils.dbping ORACLE "/" "" myserver

Here is a code example for WebLogic jDriver for Oracle:
Properties props = new Properties();
props.put("user", "/");
props.put("password", "");
props.put("server", "myserver");

Class.forName("weblogic.jdbc.oci.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:oracle",
props);

1. Use the Administration Console to set the attribute for your connection pool. The following code is an example of a JDBC connection pool configuration using the WebLogic jDriver for Oracle:

<JDBCConnectionPool
Name="myPool"
Targets="myserver,server1"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="1"

MaxCapacity="10"
CapacityIncrement="2"
Properties="databaseName=myOracleDB"
Submitted by: Administrator

Read Online BEA Weblogic Job Interview Questions And Answers