Connecting to LDAP
Moderators: chulett, rschirm, roy
Connecting to LDAP
Hi All,
We have a requirement to get data from LDAP server via Datastage.
What are the steps that needs to be followed to get data from LDAP?
Is there any plug in in Datastage 8.7 for this task
I have gone through some of the posts here and couldn't get much out of them
Can you please guide me
Regards
Aj
We have a requirement to get data from LDAP server via Datastage.
What are the steps that needs to be followed to get data from LDAP?
Is there any plug in in Datastage 8.7 for this task
I have gone through some of the posts here and couldn't get much out of them
Can you please guide me
Regards
Aj
-
- Participant
- Posts: 342
- Joined: Tue Nov 04, 2008 10:38 am
- Location: Chennai, India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I think the first thing you need to do is to find an LDAP administrator on site from whom you can obtain these details. A Java practitioner would be a good find also. Your lack of experience is telling; learn from those experts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi All,
sorry for delay in response
Actually i didn't find a resource from client side who can help me with this task
Unfortunately i couldn't get any Java resource to get this right. ( My lack of Java experience is also closing the doors)
I was looking at some of the older posts and they refer to using the commands -- csvde ,ldapsearch
Can you please guide to query ldap data from Datastage by uisng a DSN OR by using ldapsearch
please guide me the best approach
Regards
Aj
sorry for delay in response
Actually i didn't find a resource from client side who can help me with this task
Unfortunately i couldn't get any Java resource to get this right. ( My lack of Java experience is also closing the doors)
I was looking at some of the older posts and they refer to using the commands -- csvde ,ldapsearch
Can you please guide to query ldap data from Datastage by uisng a DSN OR by using ldapsearch
please guide me the best approach
Regards
Aj
Hi All,
I found the below ways to connect to "LDAP" and fetch files
Is there any specific syntax for this and should this also be updated in odbc.ini ?
Please share your ideas
Regards
Aj
I found the below ways to connect to "LDAP" and fetch files
I would like to try option 1 , to create an DSN to fetch the files from AD1. Use a third-party ODBC driver to access your LDAP server
2. Use a Java Stage in the Designer client to use Java Naming and Directory Interface (JNDI) to pull data from the LDAP enabled directories. The Java Stage is part of the Java Pack, which is an add-on product.
3. Create a LDAP search script using the LDAPsearch command. You can then call this script using the ExecSH(in the Job Properties) and redirect the output to a file which can then be read into DataStage Designer.
Is there any specific syntax for this and should this also be updated in odbc.ini ?
Please share your ideas
Regards
Aj
Sorry, I can't help you with specifics since I have not gone down that path before.
Talking to your LDAP admin is probably a good place to start... you need to find out what vendor is the supplier of your directory service. Then I would see if that vendor provides an ODBC driver... Next would be a google search to see if there are any other ODBC driver providers for your directory service.
Be prepared to fork over some $ unless you're lucky enough to find an open source solution.
Mike
Talking to your LDAP admin is probably a good place to start... you need to find out what vendor is the supplier of your directory service. Then I would see if that vendor provides an ODBC driver... Next would be a google search to see if there are any other ODBC driver providers for your directory service.
Be prepared to fork over some $ unless you're lucky enough to find an open source solution.
Mike
As has been noted above in various replies, you need one or more of the following:
a) someone at your company, who is responsible for LDAP, to research available (if any) ODBC drivers. You can't easily do this yourself--- it needs to be someone who is very close to the LDAP environment at your site, who knows the vendor, provider and can assist with this research and activity
b) someone at your company who is aware of LDAP and also of Java and knows how to read LDAP with Java. It should be an experienced Java person. The company needs to hire that person or find such a person to assist in DataStage integration using JavaPack, which (in general) is documented in many places here in the forum, the formal documentation, and elsewhere on the web.
You can't do this one alone without the skills above unless you have lots of time for research, testing, playing, etc.
Ernie
a) someone at your company, who is responsible for LDAP, to research available (if any) ODBC drivers. You can't easily do this yourself--- it needs to be someone who is very close to the LDAP environment at your site, who knows the vendor, provider and can assist with this research and activity
b) someone at your company who is aware of LDAP and also of Java and knows how to read LDAP with Java. It should be an experienced Java person. The company needs to hire that person or find such a person to assist in DataStage integration using JavaPack, which (in general) is documented in many places here in the forum, the formal documentation, and elsewhere on the web.
You can't do this one alone without the skills above unless you have lots of time for research, testing, playing, etc.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Hi All,
With the help from one of my Java associate , we have managed to get the Java code to connect to Active Directory.
Below is the code which tests the connection to Active Directory
The Issue here is sometimes the Job sexecutes succesfully and sometimes it doesn't
It doesn't give me proper error message when it fails also and below is FATAL message i get
Under Java Client Stage, I have my Transformer class name and path of it under Users's Class Path
and i Haven't passed any values under Java Virtual Machine Options
Can any one of you please guide me to resolve this / identify what the root cause for this problem
Regards
Aj
With the help from one of my Java associate , we have managed to get the Java code to connect to Active Directory.
Below is the code which tests the connection to Active Directory
Code: Select all
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import com.ascentialsoftware.jds.Row;
import com.ascentialsoftware.jds.Stage;
public class TestConnection extends Stage{
private int isInitialized = 0;
@Override
public void initialize() {
}
@Override
public int process() {
info("******** inside process");
if(isInitialized == 1 ){
return OUTPUT_STATUS_END_OF_DATA;
}
try {
info("******** inside try");
DirContext dctx = new InitialDirContext(getEnvironment());
info("******** Established connection");
dctx.close();
Row outputRow = createOutputRow();
outputRow.setValueAsString(0,"Connected");
writeRow(outputRow);
isInitialized++;
return OUTPUT_STATUS_READY;
} catch (Exception e) {
fatal("Error while connecting");
return OUTPUT_STATUS_END_OF_DATA;
}
}
@Override
public void terminate() {
// TODO Auto-generated method stub
super.terminate();
}
private static Hashtable getEnvironment() {
Hashtable environmet= new Hashtable(11);
environmet.put(Context.SECURITY_PRINCIPAL,"USERNAME");//User
environmet.put(Context.SECURITY_CREDENTIALS, "PASSWORD");//Password
environmet.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
environmet.put(Context.PROVIDER_URL,"ldap://URL:389");
environmet.put("com.sun.jndi.ldap.connect.pool", "true");
return environmet;
}
public static void main(String[] args)throws Exception{
DirContext dctx = new InitialDirContext(getEnvironment());
System.out.println("Connected Successfully");
dctx.close();
}
}
It doesn't give me proper error message when it fails also and below is FATAL message i get
My Job design is : Java Client Stage ----> Sequential File StageJava_Client,0: Failure during execution of operator logic.
Under Java Client Stage, I have my Transformer class name and path of it under Users's Class Path
and i Haven't passed any values under Java Virtual Machine Options
Can any one of you please guide me to resolve this / identify what the root cause for this problem
Regards
Aj
I can only guess at the moment....it certainly seems like you have included the necessary methods. Do you have any simpler samples that work all the time? There is sample code at my blog (see below)....does that work? When you say it works "sometimes".....what is different?
One "maybe" issue is the info calls and other warning or fatal calls I'd you use them. Comment them all out. I have seen instances when any of the log features caused issues.
Ernie
One "maybe" issue is the info calls and other warning or fatal calls I'd you use them. Comment them all out. I have seen instances when any of the log features caused issues.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Hi Ernie,
This is our First Java program that we are calling from DataStage
I tried searching your blog, to find a sample code that connects to Active directory , but couldn't find it
Can you please guide me to find the sample code for AD
When i say it works sometimes- It happened to me that when we run the job for the first time it executes perfectly and when we run it there after it fails
I will also try removing the Info calls and see if it helps
Regards
Aj
This is our First Java program that we are calling from DataStage
I tried searching your blog, to find a sample code that connects to Active directory , but couldn't find it
Can you please guide me to find the sample code for AD
When i say it works sometimes- It happened to me that when we run the job for the first time it executes perfectly and when we run it there after it fails
I will also try removing the Info calls and see if it helps
Regards
Aj
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: