Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Have Programming Question? Ask it here!

priti tandel
1 Answer(s)      a year and 10 months ago
Posted in : Java Server Faces Questions

here is my doesn't work plz help me

import*; import java.sql.*;

import javax.servlet.*; import javax.servlet.http.*;

public class priti1 extends HttpServlet{ int counter = 0; public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { response.setContentType("text/html"); PrintWriter pw = response.getWriter(); counter++; Connection con; Statement st;

try{ Class.forName("").newInstance(); pw.println("successful"); pw.println("At present the value of this counter is " + counter +"tiesore");

con=DriverManager.getConnection("jdbc:mysql://localhost/priti","root","pritishine"); System.out.println("connection"); st=con.createStatement(); st.executeQuery("use priti"); st.executeUpdate("insert into emp_sal values('uiu',89)"); pw.println("succes"); con.close(); } catch(Exception e){ System.out.println(e); }

} }

View Answers

October 10, 2012 at 11:01 PM

hi, u give query like as bellow.

"insert into emp_sal values("+'uiu'+","+'88'+")"

Related Tutorials/Questions & Answers: