public class Main {
public static void main(String[] args) {
Scanner In = new Scanner(System.in);
System.out.print("Введите a: ");
int A = In.nextInt();
System.out.print("Введите b: ");
int B = In.nextInt();
try {
sum(A, B);
}catch(ArithmeticException e) {
System.out.println(e.getMessage());
}
}
static int sum(int a,int b) /* не уверен, что нужно */ throws ArithmeticException {
if (a<0) {
throw new ArithmeticException("a меньше 0");
} else if (b<0) { // моя очепятка детектед.... чеккед и корректед
throw new ArithmeticException("b меньше 0");
}
return a+b;
}
// ....
ResultSet result = stat.executeQuery("SELECT damage FROM bleed WHERE nickname = '" + nickname + "'");
rs.next(); // от это!!!!
int count = result.getInt(1);
// ...
При открытии набора данных ResultSet курсор расположен перед первой строкой, и первый вызов next передвигает его на первую строку.
javax.servlet.Filter
), в который вставить эти строчки - tutorials.jenkov.com/java-servlets/servlet-filters.html