Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

why i'm getting this error com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException?

Exactly I've getting this error, and the error line was following as:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'employee WHERE dep_id=29' at line 1

1.Userdao:

public void deleteUser(int dep_Id)
{
    try
    {
        PreparedStatement ps=connection.prepareStatement("delete from employee where dep_id=?");
        ps.setInt(1, dep_Id);
        ps.executeUpdate();
    }
    catch(SQLException e)
    {
    System.out.println(e);
    }
}

2.Usercontroller.java:

if(action.equalsIgnoreCase("delete"))
        {
        int dep_Id=Integer.parseInt(request.getParameter("dep_Id"));
        dao.deleteUser(dep_Id);
        forward=EMPLOYEE_LIST;
        request.setAttribute("users",dao.getAllUsers());
        //request.setAttribute("users",dao.getAll());
        }

3.employeelist.jsp:

<tbody>
        <c:forEach items="${users}" var="user">
            <tr>
            <td><c:out value="${user.dep_id}"/></td>
            <td><c:out value="${user.empName}"/></td>
            <td><c:out value="${user.empAddress}"/></td>
            <td><c:out value="${user.depName}"/></td>

            <td><a href="UserController?action=edit&dep_Id=<c:out value="${user.dep_id}"/>">Update</a></td>
            <td><a href="UserController?action=delete&dep_Id=<c:out value="${user.dep_id}"/>">Delete</a></td>

            </tr>
        </c:forEach>
    </tbody>

2 answers

1 accepted

0 votes
Answer accepted

Could you explain what this has to do with Atlassian products?

thanks in advance.........

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Asked in Off-topic

Inspirational Books 📚

Is there any book that inspired you and helped you better and broader perspective? Please drop their names. Would love to read 💙

79 views 3 0
View question

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you