This content has been marked as final.
Show 2 replies
-
1. Re: how to configure jboss to use Mysql and LDAP ?
wmac Aug 8, 2004 8:49 AM (in response to madadi)Hello,
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 { try { Class.forName(driver).newInstance(); 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); conn.setAutoCommit(false); Statement s = conn.createStatement(); System.out.println("Creating new tables..."); s.execute("create table Skill(name varchar(16), description varchar(64))"); conn.commit(); s.close(); conn.close(); System.out.println("Committed transaction and closed connection"); } catch (SQLException ex) { System.out.println("SQL Exception thrown: "+ex); ex.printStackTrace(); } // shutdown cloudscape // this always throws an exception try { DriverManager.getConnection("jdbc:mysql:;shutdown=true"); System.out.println("Database did not shut down normally"); } catch (SQLException ex) { System.out.println("Database shut down normally"); } } //main ends }
Regards,
Mac
Programmernet.org -
2. Re: how to configure jboss to use Mysql and LDAP ?
darranl Aug 9, 2004 10:12 AM (in response to madadi)Mac,
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.