I am pretty sure that this worked before, but eclipse says there is error with it in throw line.
try{}
}catch(Exception e){
throw e; }
In my old student project I wrote :
try {
Class.forName("org.postgresql.Driver");
this.connection = DriverManager.getConnection(
DataSource.getURL(), DataSource.getUserName(), DataSource.getPassword());
} catch (ClassNotFoundException e) {
System.out.println("Could not find driver to connect to database. Please make"
+ "sure the correseponding postgreSQLjdbc library is added.");
throw e;
} catch (SQLException e) {
System.out.println("Username or password is not correct");
throw e;
}
and it was perfect.
Only this type works, but it is not what I want
throw new UnsupportedAddressTypeException();