English 中文(简体)
GWT JDBC LDAP 联系失败
原标题:GWT JDBC LDAP connection fails

I am trying to connect my GWT application to an ldap server using jdbc, but could not make it work so far.

这里是我试图与它联系的法典样本:

    String ldapConnectString = "jdbc:ldap://SERVERIP:389/dc=SERVERNAME,dc=office,dc=COMPANY,dc=com?SEARCH_SCOPE:=subTreeScope";
    java.sql.Connection con;
    try {
        con = DriverManager.getConnection(ldapConnectString,"cn=USERNAME","PASSWORD");

    } catch (SQLException e) {
        System.out.println("An error has ocurred!!!  Connection failed");
        e.printStackTrace();
    }

The example I used to write this is: http://myvd.sourceforge.net/bridge.html

When I run the application I get following error message:

java.sql.SQLException: No suitable driver found for jdbc:ldap://SERVERIP:389/dc=SERVERNAME,dc=office,dc=COMPANY,dc=com?SEARCH_SCOPE:=subTreeScope

我感谢任何帮助。

Edit: The code sample I provided is running on server side accessed by RPC. I included 2 jar files in my lib/ directory downloaded from here: http://sourceforge.net/projects/myvd/files/jdbc%20ldap%20bridge/jdbc%20ldap%20bridge%202.1/jdbc-ldap-2.1.zip/download

问题回答

You generally need to register the JDBC driver before you can connect to the backend.

类似情况

DriverManager.registerDriver(new com.octetstring.jdbcLdap.sql.JdbcLdapDriver());

在建立联系之前。

http://publib.boulder.ibm.com/infocenter/iadthelp/v7r5/index.jsp?topic=/com.ibm.etools.iseries.tool Box.doc/jdbcdrvr.htm” rel=“nofollow”> 登记司机的路径





相关问题
MaxPooledStatements setting in JDBC oracle

I can t figure out how to set MaxPooledStatements in Oracle using the Oracle thin JDBC driver. Could someone point me in the right direction?

pass ResultSet from servlet to JSP

I am doing the following in my SampleServlet.java //Fill resultset from db .... try { ArrayList Rows = new ArrayList(); while (resultSet.next()){ ArrayList row = new ArrayList(); ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

Mysql session variable in JDBC string

am using this connection string to connect to mysql from java: jdbc:mysql://localhost:3306/db?noDatetimeStringSync=true&useUnicode=yes&characterEncoding=UTF-8 is it possible to set the ...

热门标签