aspose file tools*
The moose likes Web Services and the fly likes Jdbc Connection pooling using apche tomcat6.0.14 and axis2--please help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jdbc Connection pooling using apche tomcat6.0.14 and axis2--please help me" Watch "Jdbc Connection pooling using apche tomcat6.0.14 and axis2--please help me" New topic
Author

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

Deepti Guduru
Greenhorn

Joined: May 22, 2008
Posts: 12
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

Joined: May 17, 2008
Posts: 20
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jdbc Connection pooling using apche tomcat6.0.14 and axis2--please help me