Il seguente blocco di codice Jsp mi stampa "Il flusso è già stato chiuso". La query che viene composta funziona perfettamente su iSQL Plus (stiamo parlando di Oracle). Commentando riga dopo riga ho scoperto che l'eccezione viene lanciata da 'approfondimenti = rst.getString(1);'
Qualcuno ha idea del motivo?
} else {
sql = "SELECT approfondimenti AS a FROM servizio WHERE nome='" + request.getParameter("id") + "'";
out.print(sql);
try {
connection = DriverManager.getConnection(url, username, password);
stmnt = connection.createStatement();
rst = stmnt.executeQuery(sql);
rst.next();
if (rst.getString(1)==null && rst.getString(1).length()>0) {
approfondimenti = "";
} else {
approfondimenti = rst.getString(1);
}
approfondimenti = "";
} catch (SQLException e) {
msg = e.toString();
}
}

Rispondi quotando