Hi! I am trying to insert some data in my database using jsp. I have already created register.jsp and insert.jsp. But what i get while click add button after have put some data is this error
Laura,
It looks like one of those fields is being submitted empty. Do you have any validations?
Also, two pieces of advice:
1) It's considered bad practice to have JDBC (or any Java code really) in a JSP. Search for MVC to read more on this.
2) It's better to use a PreparedStatement rather than a Statement. The code is easier to read and you don't have to worry about SQL Injection.
Even when i put data and click insert (shto in my language) it gives me the same error is seems like ID is not an integer or something like that. When i create my form should i put type="number" instead of "text" for id?
I am new at jsp and this is the only way because i got a problem when using only Java to create connectionManager, DatabaseObject..