Category Archives: Oracle

Checking for a User in OID

Test to see if a user is already in OID

The following java code checks to see if there is a user in OID, returning true if they are there.


import oracle.ldap.util.*;

import oracle.ldap.util.jndi.*;
import java.util.*;
import javax.naming.*;



public class Application1 {

InitialDirContext ctx;
public Application1() throws NamingException {
// Create InitialDirContext

try {

ctx  = ConnectionUtil.getDefaultDirCtx(“linux02”, “389”, “cn=orcladmin”, “orcladmin1”);

} catch (NamingException e) {

throw e;


public static void main(String[] args) throws NamingException {

Application1 appl1 = new Application1();

if (appl1.exec(“cn=mark.allen,cn=Users,dc=markcallen,dc=com”))

System.out.println(“Found mark.allen”);

if (! appl1.exec(“cn=unknown,cn=Users,dc=markcallen,dc=com”))

System.out.println(“Could not find unknown”);
public boolean exec(String userId) {

try {

Util.getUserDn(ctx, userId, Util.IDTYPE_DN, null);
} catch (oracle.ldap.util.NoSuchUserException e) {

return false;


catch (UtilException e) {

throw e;


return true;



Oracle Enterprise Linux Virtual Machine Setup

How to create a VMware virtual machine to run Oracle Enterprise Linux using VMware Workstation 6.

Startup VMware Workstation 6.Go to File -> New -> Virtual MachineClick Next

Select Custom

Select Workstation 5
– this is required if you are going to run the VM under VMware Server 1.x

Select Linux and Red Hat Enterprise Linux 4

Virtual Machine Name: Oracle Enterprise Linux

Number of Processors – 1

Memory – 1024 MB

Network connection – Bridged

SCSI – LSI Logic

Create a new Virtual Disk


Size – 20 GB
Split into 2GB files

Disk file – root.vmdk

Click Finish