HTTP Status 500 – javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state

when i want to add product there is an error “HTTP Status 500 – javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state” in my managecart.jsp.

here is my code in managecart.jsp

<%
                String id = request.getParameter("id");
                ResultSet rs = st.executeQuery("select * from Product where   Productid = " + id);
                rs.next();
            %>
        <br/>
        <br/>
        <div class="container3">
            <div class="welcome">
                <br/>
                <h2 class="nol">Manage Cart</h2>
                <h4 class="nol">Cart Form</h3>
                <br/>
            </div>
                <br/>
            <div class="login">
                <form method="POST" action="doAddCart.jsp?id=    <%=rs.getString(1)%>">
                    <span>Welcome admin,</span>
                    <span style="margin-left:250px;">2 Online</span><br/>
                    <br/><hr>
                    <h2 style="margin-left:30px;"><%=rs.getString(2)%></h2>
                    <div>
                        <img src="c.jpg" style="height:160px;width:160px;float:left;">
                        <div style="float:left;margin-left:30px;margin-top:20px;">
                            <div class="">
                                <div class="priceUsr">
                                    <div style="text-align:left;">
                                        Rp.<br/>
                                        <span class="price_tagUsr"><%=rs.getString(4)%></span>
                                    </div>
                                </div>
                            </div>
                            <div>
                                    <div class="prd_type">
                                        type<br/>
                                        <span class="type"><%=rs.getString(3)%></span>
                                    </div>
                                    <div class="prd_stock">
                                        stock<br/>
                                        <span class="stock"><%=rs.getString(5)%></span>
                                    </div>

i dont know whats wrong… help…


Source: jsp

Leave a Reply