hi.
I am begining in the world of java/servlet.
and... I am still learning (without
IDE)... I am trying a simple insert in a database postgresql.
it is very simple:
1) a page
JSP with forms. the user fill 4 fields.
2) the datas from froms go to the
servlet. the servlet receives those datas and it put them in a object. after that, those data are rescued from object, and the servlet open the conection to the database (postgres). so the servlet do the "insert".
3) all ok? it happens a redirection to the jsp "sucesso.jsp" (success). all wrong? it happens a redirection to the jsp "errorjsp" (error)
observation: I am respecting the MVC.
when I compile the code below, I receive a message of error.
what am I doing wrong?
the message-error when I compile is:
error: invalid method declaration; return required
inserir();
1 error
I confess that I dont discover so far, how to pass the objetc like a argument/parameter...
there are not an example of CRUD in the internet without IDE...
(I dont like IDE)
an "insert" is so simple in others languages of programming... but is not in the
java servlet...
I have been reading books of java, but I didnt find anything simple example that resolve this "problem".
anyone help me please?