Posts

Showing posts from February, 2009
Connection pooling in JBOSS with MYSQL Step 1 : copy mysql-connector-java-5.0.7-bin.jar into jboss/server/default/lib or jboss/server/all/lib Step 2 : config the data sources with mysql-ds.xml and config the login-config.xml. Mysql-ds.xml TestSQL jdbc:mysql://localhost:3306/frameworkdb com.mysql.jdbc.Driver root password java/TestSQL Login-config.xml root root password jboss.jca:service=LocalTxCM,name=TestSQL Step 3: then create your connection pooling class in java public String dbConnection(String test) {String str = "";try {Context initContext = new InitialContext();DataSource ds = (DataSource) initContext.lookup("java:TestSQL");Connection con = ds.getConnection();Statement st = con.createStatement();ResultSet rs=st.executeQuery("Select * from authentication");while(rs.next()){str+= "--"+rs.getString(2);}catch (Exception e) {return e.getMessage();}return str;} Step 4 : create the remaining class and deploy it into jboss as war file, in jboss/s...