U can use a Database class like below and include it in your jsp page and use it,
so that u get a layer of abstraction
Code:
import java.sql.*;
public class Database
{
private String uri, username, password;
public Database() {
this.uri = "your_uri";
this.username = "your_username";
this.password = "your_password";
}
public Table getTable( String name ) {
return new Table( this, name );
}
Connection getConnection() throws SQLException {
Connection connection =
DriverManager.getConnection( uri, username, password );
return connection;
}
}
check,
http://www.ibm.com/developerworks/ja...rap/index.html
