I've done it with the following code:

try {
  conn = getCon();
  if (conn != null) {
 String employee_id = request.getParameter("employee_id");
 String name = request.getParameter("name");

 PreparedStatement pstmt = conn.prepareStatement("INSERT INTO JSP_TESTS
VALUES ( ?, ?)");
 pstmt.setString(1, employee_id);
 pstmt.setString(2, name);

 pstmt.executeUpdate();

-----Original Message-----
From: Jose Castro <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Segunda-feira, 24 de Abril de 2000 15:55
Subject: Error Inserting in Database - Part II


Hi,

Thanks to all, for your help about my mail "Error Inserting in Database".
Now the error is the following:
Is in the code, line 43 really missing something ?!?!

Thanks in advance,
Jos� Castro

E:\weblogic\myserver\classfiles\examples\jsp\_dbtest\_Personal_95_form_95_v4
_95_2.java:100: ')' expected.
probably occurred due to an error in dbtest\Personal_form_v4_2.jsp line 43:
String employee_id = request.getParameter("employee_id");

37. <%
38. try
39. {
40.  conn = getCon();
41.  if (conn != null)
42.  {
43. String employee_id = request.getParameter("employee_id");
44. String name = request.getParameter("name");

...

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to