Hi All,
Iam doing a project using axis2 webservices.Iam using apache tomcat6.0.14 as a server.Iam able to complete the project using
jdbc connection. But now my task is to do jdbc connections using connection pooling.I googled it, but unable to find anything. please help me .
This is my simple DatabaseConnection program.
public class DBConnection {
private Connection conn;
private Statement stmt;
private
String url = "jdbc:mysql://localhost/cmpe273";
private String driver = "com.mysql.jdbc.Driver";
private String login = "root";
private String password = "root123";
public DBConnection() {
conn = null;
stmt = null;
getConnection();
}
public Connection getConnection() {
try {
Class.forName(driver).newInstance();
conn = (Connection) DriverManager.getConnection(url, login,
password);
System.out.println(url);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException sqlex) {
sqlex.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
}
return conn;
}
}