Hi,


I'm developing a new system for internet.
How can I connect to a DB2 database?
My code is below:

public abstract class Repository {

private static final String DRIVER = "COM.ibm.db2.jdbc.net.DB2Driver";
private static final String URL = "jdbc:db2301:1000";
private static final String USER = "john";
private static final String PASSWORD = "12345";


protected Connection obterConexao() throws RepositoryException {

Connection con = null;

try {
Class.forName(DRIVER);
} catch(ClassNotFoundException cnfe) {
System.err.println("Error on loading driver: " + cnfe.getMessage());
}

try {
con = DriverManager.getConnection(URL, USER, PASSWORD);

} catch (SQLException sqle) {
System.err.println("Error on getting connection: " + sqle);
}



Can anybody help me with a good example?
Thanks in advance