• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
}
}
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic