1 2 Previous Next 16 Replies Latest reply on Mar 10, 2009 4:02 PM by knice147 Go to original post
      • 15. Re: Is it possible to get a database connection with JPA without using hibnernate as well?
        swd847

        You put the stored procedure sql in the annotations, there is a tutorial here

        • 16. Re: Is it possible to get a database connection with JPA without using hibnernate as well?
          knice147
          Could I possibly do it this way:

          I have read examples that show you can get the database connection from the session...

          <code>
          Connection con=session.connection();
                CallableStatement cst=con.prepareCall("{call first-procedure(?,?)}");
                cst.registerOutParameter(2,Types.Integer);
                cst.setInt(1,20);
                cst.execute();
                int res=cst.getInt(2);
               s.o.p(res);
               ses.close();
          </code>
          Now can I manipulate the following:

          <code>
          Connection con=session.connection();
                UtilityClass u = new UtilityClass(con);
                u.saveDAO(customerDAO);
                ses.close();
          </code>

          from an Action on the ActionClass.
          Also, where does this session come from?  I am assuming this is something hibernate.

          <blockquote>
          _Stuart Douglas wrote on Mar 10, 2009 08:10:_<br/>

          You put the stored procedure sql in the annotations, there is a tutorial [here=>http://timezra.blogspot.com/2008/11/hibernate-updates-and-oracle-stored.html]
          </blockquote>

          Click HELP for text formatting instructions. Then edit this text and check the preview.
          1 2 Previous Next