explain me more

its not good approach sir !



----- Original Message -----
From: "Vaishali S. Pandya" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 05, 2002 1:55 PM
Subject: responce has commited


> my java code is
>
> package pkgs;
> import java.lang.*;
> import java.sql.*;
> public class MyConnection{
>      public static Statement getCon(int i){
>           Connection con=null;
>           Statement stmt=null;
>           try{
>                Class.forName("com.informix.jdbc.IfxDriver");
>           }
>           catch(Exception e){
>                System.out.println("Error 1");
>                System.out.println(e);
>           }
>           try{
>                if (i==0){
>                     //connect with workflow db
> con=DriverManager.getConnection
>
("jdbc:informix-sqli://192.101.11.05:2150/workflow:INFORMIXSERVER=msdp","use

r","password");
>                }
>                else{
>                     //connect with hrms db
> con=DriverManager.getConnection
>
("jdbc:informix-sqli://192.101.11.05:2150/hrms:INFORMIXSERVER=msdp","user","

password");
>                }
>                stmt = con.createStatement();
>           }
>           catch(Exception e){
>                System.out.println("Error 2");
>                System.out.println(e);
>           }
>           return stmt;
>      }
>
>      public static int doInsert(Statement s, String ins)
>      {
>           int rval=0;
>           try{
>                s.executeUpdate(ins);
>                rval=0;
>           }
>           catch(Exception e){
>                rval=1;
>           }
>           return(rval);
>      }
> }
>
> jsp code is
>
>           MyConnection con = new MyConnection();
>           Statement stmt = con.getCon(1);
>           String qry="update hrm_employee_mas set emp_empname = '" +
> request.getParameter("ename") + "'";
>           int rval = con.doInsert(stmt,qry);
>
> it gives me Response has already been committed
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to