il codice adesso č cosė:
public static Utente iserimentoUtente(String username,String password,int idProgramma,String ragioneSociale,boolean isAmministratore)throws ErroreAccessoDatiException,SQLException{
if(dataSource == null){
throw new IllegalStateException("LoginDBManager non ha ancora a disposizione un DataSource valido");

}
String sqlQuery = "Update utenti set ragioneSociale=(?) where username =(?) ";

Connection connection = null;
PreparedStatement pStat = null;
ResultSet rSet = null;
try{
int recordAggiornati;
connection = dataSource.getConnection();
pStat = connection.prepareStatement(sqlQuery);
pStat.setString(1,ragioneSociale);
pStat.setString(2,username);


recordAggiornati= pStat.executeUpdate();
Utente utente;
if (rSet.next()){
utente = new Utente(username,rSet.getString("ragioneSociale"),r Set.getString(3),rSet.getString(4).equalsIgnoreCas e("S"),ProgrammiModuli.getProgramma(rSet.getInt("i d")));


return utente;
}
else {
return null;
}

}
catch(SQLException errore){
throw new SQLException(errore.getMessage(),String.valueOf(er rore.getErrorCode()));
}
catch(ErroreAccessoDatiException errore){
throw new ErroreAccessoDatiException(errore.getMessage(),Str ing.valueOf(errore.getErrorCode()));
}
finally{
try{rSet.close();}catch(Exception e){}
try{pStat.close();}catch(Exception e){}
try{connection.close();}catch(Exception e){}
}
}
E sicuramente la creazione di utente
manca rSet e la select per riprendere di nuovo i dati dal db č possibile fare due operazioni una di update e l'altra di select nello stesso metodo?