public Sender getSenderInfo(String username) throws SQLException {
Connection connection = this.dataSource.getConnection();
PreparedStatement st = connection.prepareStatement(dbDriver
.getQueries().getUserQueries().getSql_GET_USER_INFO());
ResultSet rs = null;
Sender bean = new Sender();
try {
st.setString(1, username);
rs = (ResultSet) st.executeQuery();
if (rs.next()) {
UserInfo info = new UserInfo();
UserSettings settings = new UserSettings();
bean.setName(rs.getString("user_name"));
info.setCity(rs.getString("user_city"));
settings.setSignature(rs.getString("user_signature"));
bean.setTotalMess(rs.getInt("tot_mes"));
bean.setStatus(rs.getInt("user_status"));
bean.setSettings(settings);
bean.setInfo(info);
}
} finally {
if (rs != null) {
rs.close();
}