/**
* Tests that the entered information is valid and can be used to open a conneciton.
* Does not store the open connection.
*/
public void okAction() {
DBConnectionInfo info = getConnectionInfo();
ClassLoadingService classLoader = getApplication().getClassLoadingService();
// try making an adapter...
try {
info.makeAdapter(classLoader);
}
catch (Throwable th) {
reportError("DbAdapter Error", th);
return;
}
// doing connection testing...
// attempt opening the connection, and close it right away
try {
Connection connection = info.makeDataSource(classLoader).getConnection();
try {
connection.close();
}
catch (SQLException ex) {
// ignore close error