2 Replies Latest reply on Aug 9, 2004 10:12 AM by Darran Lofthouse

    how to configure jboss to use Mysql and LDAP ?

    madadi Newbie

      Dear all,

      I want to know what are the configuration files i have to change or add to use Mysql and LDAP with JBOSS.

      Up to now i used JBOSS with Mysql ,but now i want to use LDAP also, is it possible that i can store data in both Mysql and LDAP in same time. i mean can i write a servlets,Ejb's in such a way that i can store data in Mysql and LDAP . i am working on windows and i installed LDAP on windows.

      I need to synchronize between Mysql and LDAP .information and suggestions are needed........


        • 1. Re: how to configure jboss to use Mysql and LDAP ?
          Mac Sarmady Newbie


          I don't think you need anything else to be able to use LDAP. Pure java supports LDAP (I mean J2SE).

          Again about MySQL you just need to add a MySQL jconnect JDBC driver to your CLASSPATH and load it's driver in your program as you may do in a normal pure command line Java program and use it.

          Synchronize between MySQL and LDAP?

          By the way a sample program:

          import java.sql.*;
          public class CreateAgency {
           public static void main(String[] args) {
           String driver = "com.mysql.jdbc.Driver";
           String protocol = "jdbc:mysql://localhost:3306/Agency";
           try {
           System.out.println("Loaded driver: "+driver);
           catch (Exception e)
           System.out.println("ERROR: load mysql driver failed");
           Connection conn = DriverManager.getConnection(protocol, "root", "zlogs");
           System.out.println("Connected to: "+protocol);
           Statement s = conn.createStatement();
           System.out.println("Creating new tables...");
           s.execute("create table Skill(name varchar(16), description varchar(64))");
           System.out.println("Committed transaction and closed connection");
           catch (SQLException ex) {
           System.out.println("SQL Exception thrown: "+ex);
           // shutdown cloudscape
           // this always throws an exception
           try {
           System.out.println("Database did not shut down normally");
           catch (SQLException ex) {
           System.out.println("Database shut down normally");
           } //main ends


          • 2. Re: how to configure jboss to use Mysql and LDAP ?
            Darran Lofthouse Master


            The question asked related was how to use LDAP and MySQL with JBoss, not how to use them in a J2SE application.

            The instructions you have given are for J2SE not J2EE.