File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes will servlets serve the purpose Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "will servlets serve the purpose" Watch "will servlets serve the purpose" New topic
Author

will servlets serve the purpose

Monarch Bhojani
Ranch Hand

Joined: Feb 27, 2005
Posts: 46
hello all
in my app i authenticate user against databse via servlets
Now when the user authenticates his entry is passed on to the ldap server

So how could I fetch certain entries from the relative database via servlet and put it into the ldap directory server

Reply soon

Thanks
Regards
Monarch

----- I.M.Possible----
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Isn't that a bit backwards? I was under the impression that LDAP servers are optimized for reading, and data there should not be modified often. That's what relational databases are for. So authentication is usually done with LDAP, and if some data needs to be persisted and changed often, it's done with the relational db.

Also, all the SQL and LDAP code should really be placed POJOs (plain old java objects) used by servlets, not in the servlets themselves.

Anyway, here's some helpful pages for LDAP:

JNDI basics: http://java.sun.com/products/jndi/tutorial/basics/TOC.html
LDAP through JNDI: http://www.javaworld.com/javaworld/jw-03-2000/jw-0324-ldap_p.html


-Yuriy
[ March 30, 2005: Message edited by: Yuriy Zilbergleyt ]
Monarch Bhojani
Ranch Hand

Joined: Feb 27, 2005
Posts: 46
hello
Thanks for the reply
Is it not possible that the names already exist in the directory but when the user authenticates using rel db his name is activated in directory server

Or else when authentication is done the entry is added to the directory server for the first time itself

As it is dealing with chat application there are various chat rooms
So directory could handle all the rooms differently.Is it possible??

If anyone know how LDAP would be used in a chat application please let me know soon coz the company that has given the project to us wants LDAP

As someone told that maintaining the names after authentcation would be good thing
Is he right or not??

Thanks
Regards
Monarch
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Hi Monarch,

Did the company tell you what you should use LDAP for, or did they just say "use LDAP"? As I said before, LDAP servers are optimized for reading not writing, so modifying or creating an entry in LDAP will put a greater load on your server than modifying or creating a row in a database. Once a user authenticates, why not just store that info in the session or ServletContext? But if you have to persist it for some reason, I guess "activating" a user by setting some field in an LDAP entry from "false" to "true" may make sense if the field will be read more times than it is set.

Hope that helps,
-Yuriy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: will servlets serve the purpose