Discussions

EJB programming & troubleshooting: EJB and Stored Procs

  1. EJB and Stored Procs (2 messages)

    Hi,
    I hope someone might give me some comments about how a
    stored-procedure can be used with an entity bean.

    I have an application which use a database with the following rules :
       1. no users have an INSERT, UPDATE, or DELETE access into the database.
       2. put every SQL statement, i.e. INSERT, UPDATE, DELETE, or SELECT, into a
          stored-procedure.
       3. all stored-procedures are owned by DBO.
       4. users are only allowed to execute a SELECT statement or
          run/execute a stored-procedure.

    Here are my questions :
       a. how to use a stored-procedure with an entity bean ?
       b. the database containts about 125 tables, with about 10 tables containts more
          than 10.000 records. How this can be 'mapped' ?


    Thanks,
    Benoit Aumars.

    Threaded Messages (2)

  2. EJB and Stored Procs[ Go to top ]

    The answer to you first question is that you probably have to use BMP entity beans. You can access the stored procedures using JDBC's CallableStatement, which denotes a call to a stored procedure.
    I didn't understand your second question. How you map entities to tables depends on your specific data. Maybe you could explain in more detail what you mean by "map"?

    Gal
  3. EJB and Stored Procs[ Go to top ]

    U can use the Stored procedures from an entity bean by using JDBC Callable statements. Through this u can easily access the Stored Procs in ur underlying DataStore.