javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If you remove the WHERE from the query, it won't know which record to update. And the PreparedStatement needs '?' to work in the query. As far the author field, try a new approach.
Write a class that has methods that update or do other staff with the database, and after you have tested it, use it in your .jsp. You shouldn't have too much logic in jsp files. Just html and calling methods. You shouldn't write preparedStatements and other long code calculations.
A small example of updating the db from a .jsp. (I am not saying that this will work for you)

<%
//get the parameters from the request and store them in variables
String someVariable = request.getParameter("someVariable");
//probably check the values for errors
SomeClass sc = new SomeClass();
sc.updateMethod(.......);
%>

Inside the SomeClass you should implement and TEST your queries.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I think that the concept of the query is wrong. If you want to perform an INSERT then you don't need a
WHERE ID= id
because you are inserting something that does not exist.
Perhaps you should try an UPDATE

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Use: double '\': '\\'
or single '/'

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Put it wherever you want, as long as you say in your code where is it so you can read it:
props.load(new FileInputStream("dbConnection.properties"));
When you make changes in your .properties files, you must restart the server

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The method Math.random() returns a random double between 0 and 1.
0 < Math.Random <1;
So one variation of jwenting's post :

private int diceRoll() {
  double r=Math.Random();
  //do stuff
  return /* An [U]int[/U] number between 1 and 6 */
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Try adding a System.out.println(); before the JOptionPane to see where the program stops

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If this is what you want to enter: John Smith, then try inserting
"John Smith"
By the way you don't say what exactly is you problem and what you are trying, to do. Post your inputs, what it is stored in the variable and what you wanted to be stored

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all why create two classes that do the same thing: UserInput1,UserInput2?
Just create only one that prints the message: "Give a number" and create two different instances:

UserInput1 firstNumber = new UserInput1();
int input1 = firstNumber .getUserInput1();

UserInput1 secondNumber = new UserInput1();
int input2 = secondNumber .getUserInput1();

//firstNumber , secondNumber  two different instances

As far you error, the getCalculateNegOrGreater is declared void. It does not return anything, it just prints.
So why you write:
int negGreater = negOrGreater.getCalculateNegOrGreater(Input1, Input2); ?

What is it supposed to return? The getUserInput1 in the UserInput1 class returns something that's why you wrote: int input1 = firstNumber .getUserInput1();
Just write:

negOrGreater.getCalculateNegOrGreater(Input1, Input2);
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Compile it, I think if you are console the command is >javac InputHandler.java (if I remember correctly because for a very long time I have been using IDEs) and run it with the command
>java InputHandler
Then the program will print the message in your code and then just insert the input.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It will return false. 4 cannot be divided by 8 and 16 cannot be divided by 32

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Returns true if each "father" can be divided by each of their "sons". false even if one of the fathers cannot be divided by theirs sons. If a node is null, it does not check it and returns true.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

At which line do you get the Error?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

All the subclasses can use the super's class methods. If you write:

Employee e = new Nurse();

The e will be able to use all the Employee's methods and the Nurse's methods but not the Janitors.
Try to put those isSomething() methods in the superclass or have one method in superclass that returns something that tells you the proffession of the created object