• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jdbc Connection pooling using apche tomcat6.0.14 and axis2--please help me

 
Deepti Guduru
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
}
}
 
NarendraBabu Bandaru
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please have a look into the below URL for more details.

http://www.onjava.com/pub/a/onjava/2006/04/19/database-connection-pooling-with-tomcat.html

I think Web container will take care of DB Connection pooling.

Thanks,
NAREN
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic