-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Unable to insert data fetched from ldap into sql server..
PostPosted: Fri May 18, 2007 5:09 am 
Newbie

Joined: Fri May 18, 2007 4:58 am
Posts: 1
public void storeToSql(NamingEnumeration resultEnum)
{
try {
int count = 0;
while (resultEnum.hasMore())
{
System.out.println("count =" + ++count);
SearchResult result = (SearchResult) resultEnum.next();
// attributes returned by search
Attributes attrs = result.getAttributes();
NamingEnumeration e = attrs.getAll();
GlobalUsers g = new GlobalUsers();
while (e.hasMore() )
{
Attribute attr = (Attribute) e.next();
NamingEnumeration t = attr.getAll();
System.out.println("getID..Values======"+attr.getID());
System.out.println("attr.get()Values======"+attr.get()); if (attr.getID().equals("eTGlobalUserName")) {
String temp=(String) t.next();
System.out.println("temp====="+temp);
g.setEtGlobalUserName(temp);
System.out.println("After SETTTTTTTTTT");

}

}

Session session = HibernateUtil.currentSession();
Transaction tx=session.beginTransaction();
session.save(g);
System.out.println("storing data to SQL Server");
tx.commit();

}

HibernateUtil.closeSession();
}
catch (Exception e)
{
System.out.println("Error in storing data to SQL Server");
System.out.println(e.getMessage());
}
}

}
[[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.