Hi

    I am able to find the solution for the problem  i had reported ..
     But its very funny thing

    I was sending the my query like
    "select Status_Code, Select_Type from Status_Master where Status_Name=" + "\""
+this.statusName+ "\""
    So sybase is treating this.statusName (value) as an column for that table.
    I tried by replacing  "\"" +this.statusName+ "\"" >>>> "\'" +this.statusName+ "\'"
    as suggested by G. C. miller (JOnas user)

    But  i am not getting why the same code works on one machine (local)
    and not on other which is on internet .

    Is there any problem with sending "\"" on internet .

    I am having one more doubts that
    In servlet if you pass the same query it works .
    But  when passing from jspbean why there is an error


Thanks
Ritesh



Hi

    I am Running EJbserver on two machines .
    Each is having same configuration .

    In both machine i am hving jConnect_5_2 as jdbc driver for sybase

    I am passing a string (query ) to my seesion bean
    and the steps i am doing in session bean are....

public Object getQueryResult(String sqlQ)
     throws RemoteException{

        java.util.Vector retVect = new java.util.Vector();
        System.out.println("Hello In side getqueryResult Session Beans");
        try{
           Context sessionContext = new InitialContext();
           DataSource ds  = (DataSource) sessionContext.lookup("jdbc_1");
           String   retStr= "";

           Connection con = ds.getConnection();
           Statement stmt = con.createStatement();
           ResultSet rS = null;
           rS   = stmt.executeQuery(sqlQ);
           while(rS.next()){
              retStr="";
              for(int cntr=1;cntr<=(rS.getMetaData()).getColumnCount();cntr++){
                 if(cntr==1){
                    retStr=rS.getString(cntr);
                    continue;
                 }
                 retStr +="|"+rS.getString(cntr);
              }
              retVect.add(retStr);
           }
           rS.close();
           stmt.close();
           con.close(); catch(Exception E){
           //If we are in problem then send back  the exception.
           return "Got Exception in Sssion Bean calling result set"+E;
        }
        System.out.println("Hello In side the Befor Return of Session Beans");
        return retVect;
     }


The above code perfectly gives me the result as desired  on my one machine
 But the same code when i am running on other machine i am geeeting error


    Hello is Got Exception In Create of Proposal Master>>java.rmi.ServerException:
RemoteException occurred in server
    thread; nested exception is: java.rmi.RemoteException: RuntimeException thrown by 
an
enterprise Bean; nested
    exception is: javax.ejb.EJBException>>0>>New Company>>null>>>
   QUERY>>>>>  select Status_Code, Status_Type from Status_Master where Status_Name =" 
New
Proposal"

   RET OBJ IS Got Exception in Sssion Bean calling resultset
com.sybase.jdbc2.jdbc.SybSQLException: Invalid column name ' New Proposal'.

As from the query it is clear that  "" NewProposal  "" of which status code and status
type shud be displayed.


The same code is working fine one  machine .

Is any one have any clue what exactly the error is ......


Thanks in advance
Ritesh


Community email addresses:
  Post message: [EMAIL PROTECTED]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://www.egroups.com/group/EJB-Developer



Reply via email to