[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: About JDBC-LDAP Bridge



chris,

For one, the sql query is mis-built (and appears much mike MS's ADO
provider to LDAP).  second, the base context does not appear to be an
active directory context.

Could you please send all replies and inqueries to the
openldap-seoftware list? it will allow you to recieve help from other
memebers of the community and assist in our support managment.

Marc


On Thu, 2003-07-10 at 17:46, Yen-Pin Wang wrote:
> Hi Marc:
> Thanks for replying this message, this is the code that I am trying to do.
> import com.octetstring.jdbcLdap.sql.statements.JdbcLdapSelect;
> import com.octetstring.jdbcLdap.jndi.*;
> import com.octetstring.jdbcLdap.sql.*;
> import com.octetstring.jdbcLdap.sql.statements.*;
> import java.sql.*;
> import javax.naming.directory.*;
> 
> public class test
> {
> 	public static void main(String[] args)
> 	{		
> 		Statement stmt = null;
>     	ResultSet rs = null;	
>     	try
> 		{
> 			Class.forName("com.octetstring.jdbcLdap.sql.JdbcLdapDriver");
> 			String sourceURL="jdbc:ldap://myorg.com/o=myorg.com?SEARCH_SCOPE:=subTreeScope";;
> 			java.sql.Connection con;
> 			con =DriverManager.getConnection(sourceURL,"cn=admin","password");
> 			System.out.println("Connection established........");
> 			System.out.println("Attempt to do SQL query....");
> 			stmt=con.createStatement();      
> 
>       		rs = stmt.executeQuery("SELECT OU FROM ldap://myorg.com/o=myorg.com?SEARCH_SCOPE:=subTreeScope";);
>       		while(rs.next())
>       		{
>       			System.out.println(rs.getString("OU"));
>       		}								  
>       		System.out.println("Success ...");
> 		}
> 		catch(ClassNotFoundException cnfe)
> 		{
> 			System.err.println(cnfe);
> 		}
> 		catch(SQLException sqle)
> 		{
> 			System.err.println(sqle);
> 		}
> 	}
> }
> 
> Thanks a lot!!
> Chris
-- 
Marc Boorshtein, Software Engineer
Octet String Inc.
Phone: +1-847-466-1884
Email: marc.boorshtein@octetstring.com