SQL Update exception?

Hello,

When I tomcat run this preparedstatement an exception is thrown in the java tomcat window. Though I cannot find the exception in the log files.

Could I ask if I am correct in using statement.executeUpdate() ?

Or any there is any other small errors?

Thanks

      PreparedStatement statement = null;

      try{
         conn = (Connection)source.getConnection();

         String sql = "UPDATE user SET firstname=? lastname=? email=? telno=? expertise=? WHERE email=?";

         statement = conn.prepareStatement(sql);
         statement.setString(1,req.getParameter("firstname"));
         statement.setString(2,req.getParameter("lastname"));
         statement.setString(3,req.getParameter("email"));
         statement.setString(4,req.getParameter("telno"));
         statement.setString(5,req.getParameter("expertise"));
         statement.setString(6,req.getParameter("email"));
         int rowsChanged = statement.executeUpdate();

         if(rowsChanged > 0){
            return true;
         }
      }
      catch(SQLException e){
         e.printStackTrace();
      }
AntoniRyszard656Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hongjunCommented:
try this

String sql = "UPDATE user SET firstname=?, lastname=?, email=?, telno=?, expertise=? WHERE email=?";

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hongjunCommented:
You need commas in your sql statement.
AntoniRyszard656Author Commented:
Thank you,

I would also be interested to ask, if you could explain the use of the ejb?

I wondered if the ejb was similar to hibernate, and helped in storing and retrieving objects from the database? And why text-books often dislike the ejb?

Thanks

HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

hongjunCommented:
>>I would also be interested to ask, if you could explain the use of the ejb?
Perhaps you would like to open a new question and close this one :)


hongjun
AntoniRyszard656Author Commented:
I think I will keep the question open shortly incase others was the add.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.