does not work (Compilation error: missing return statement)
public SqlMapClientTemplate getSqlTempl() throws UivException, SQLException{
try {
SqlMapClient scl = (SqlMapClient) ApplicationInitializer.getApplicationContext().getBean("MySqlMapClient");
DataSource dsc = (DataSource) ServiceLocator.getInstance().getDataSource(PIH_EIV_ORCL);
return new SqlMapClientTemplate (dsc, scl);
}
catch (NamingException ne)
{
log.error(ne.getMessage(), ne);
}
}
works:
public SqlMapClientTemplate getSqlTempl() throws UivException, SQLException{
try {
SqlMapClient scl = (SqlMapClient) ApplicationInitializer.getApplicationContext().getBean("MySqlMapClient");
DataSource dsc = (DataSource) ServiceLocator.getInstance().getDataSource(PIH_EIV_ORCL);
return new SqlMapClientTemplate (dsc, scl);
}
catch (NamingException ne)
{
log.error(ne.getMessage(), ne);
throw new SQLException("Unable to get database connection: " + ne.getMessage());
}
}
why?