0 Replies Latest reply on Dec 14, 2005 3:18 PM by * *

    ejbStore problem

    * * Newbie

      Hello
      I work with JBoss + Eclispe + Firebird. I've written a ejbStore procedure like that:

      public void ejbStore()
      {
      System.out.println("Project enter: ejbStore");
      Connection connection = null;
      PreparedStatement ps = null;

      try
      {
      connection = getConnection();

      String select = "update PROJECT set FK_LECTURER_ID = ?,FK_SUBJECT_ID = ?,"+
      " PROJECT_DAY = ?,PROJECT_HOUR = ?,CLASS_NUMBER = ?, STUDENTS_IN_GROUP = ?," +
      " NUMBER_OF_GROUPS = ? where PROJECT_ID = ?";

      ps = connection.prepareStatement(select);
      ps.setInt(1,this.getFk_lecturer_id());
      ps.setInt(2,this.getFk_subject_id());
      ps.setString(3,this.getProject_day());
      ps.setInt(4,this.getProject_hour());
      ps.setInt(5,this.getClass_number());
      ps.setInt(6,this.getStudents_in_group());
      ps.setInt(7,this.getNumber_of_groups());
      ps.setInt(8,this.getProject_id());
      ps.executeUpdate();
      }//try
      catch (Exception e)
      {
      System.out.println("Project wyjatek: ejbStore");
      e.printStackTrace();
      }
      finally
      {
      try
      {
      if (ps != null ) ps.close();
      }
      catch (Exception e)
      {}

      try
      {
      if (connection != null) connection.close();
      }
      catch (Exception e)
      {}
      }//finally
      System.out.println ("Project exit: ejbStore");
      }//ejbStore

      During testing no exception appears and it seems to work. When I call a get* method after a set* method a new value seems to be stored in the data base. But when I execute a sql query there are no changes in the table. Does anybody know what can be wrong. I think that a problem is somewhere else but I am not sure. One more thing, ejbCreate and ejbRemove method works properly.