काम नहीं करता है (संकलन त्रुटि: वापसी कथन याद आ रही):एक वापसी कथन के साथ एक कोशिश पकड़ काम के अंदर क्यों 'फेंकता है' करता है
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());
}
}
क्यों
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);
}
}
काम करता है?
आपका क्या मतलब है "काम नहीं करता"? पहले मामले में क्या होता है? – noctonura
मेरा मानना है कि यह काफी स्पष्ट था। :) –
चूंकि आप पहले मामले को काम करने की उम्मीद करते हैं, इसलिए मुझे यह पूछना है कि आप इस विधि से वास्तव में क्या उम्मीद करेंगे? –