6 Replies Latest reply on Jan 3, 2002 11:27 AM by Gordon Luk

    Problem!!! Prepare statement in ejb.

    Gordon Luk Newbie

      Hi All,

      I had a problem, that is i use prepare stement in ejb, and execute the statment, it send a not my statment. crazy!!! part of my code as following :

      -------->8---------
      String _sqlString = "SELECT ";
      _sqlString = _sqlString + "b.subsysid, a.modid, a.rightsid ";
      _sqlString = _sqlString + "INTO " + _tmpTbl + " ";
      _sqlString = _sqlString + "FROM usermodrights as a ";
      _sqlString = _sqlString + "LEFT JOIN module AS b USING(modid) " ;
      _sqlString = _sqlString + "WHERE userid = ? " ;
      _pstat = _conn.prepareStatement(_sqlString);
      System.out.println("spUserSubsystemList() : SQL : " + _sqlString);
      _pstat.setString(1, UserID);
      System.out.println("spUserSubsystemList() : Prepared : " + _pstat.toString());
      ---->8-------

      ----- Result --------
      spUserSubsystemList() : SQL : SELECT b.subsysid, a.modid, a.rightsid INTO _tmp_gordon_usl FROM usermodrights as a LEFT JOIN module AS b USING(modid) WHERE userid = ?

      spUserSubsystemList() : Prepared : org.jboss.pool.jdbc.PreparedStatementInPool@25491d
      ------------------------
      Please help!!! what's wrong with me, i don't thing cann't use prepare statement in ejb. :~(

      Gordon