Announcement Announcement Module
Collapse
No announcement yet.
running as an Oracle stored procedure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • running as an Oracle stored procedure

    I'm working on a project that uses Spring. Data access is sometimes though Hibernate and sometimes through jdbc, and we use an Oracle 9i database .

    I have some code that does extensive database access, and I imagine performance would improve if I could run that code as a Java stored procedure in Oracle. But a quick glance at Java stored procedures makes me think that it would be impossible to do so without a significant rewrite. That's because my Spring/j2ee code relies on the concept of a DataSource (either explicitly or implicity, via a HibernateSessionFactory), and I don't see that concept expressed in the small amount of Oracle documentation I've read. Stored procedures seem to rely instead on the less abstract and less flexible notion of Connection.

    I hope I've simply missed something obvious. So I ask the forum, has anyone successfully run Spring enabled code inside an Oracle stored procedure? If so, could you point me to some documentation that would help me do this?

  • #2
    Spring has special support for running StoredProcedures. You can see more about this at http://static.springframework.org/sp...toredProcedure. Unfortunatelly I never used stored procedures, so I can't give you more advice. A DataSource is simply a factory for Connections, so in fact you're already using Connections, but Spring hide this, opening and closing them for you.

    Comment


    • #3
      running as an Oracle stored procedure

      Thanks rfhayashi, but I'm actually not asking about how to call a stored procedure. I'm asking how to put Spring enabled Java code into an Oracle stored procedure so that the Java code can run *inside* the database. The only examples I've seen of Java stored procedures have been fairly trivial-- I've never seen one that didn't just pass the Connection around in method signatures. I'd much rather reuse the JDBCDaoSupport and HibernateDaoSupport extensions that I've already written and used throughout my application, but I don't know whether that's possible.

      Comment

      Working...
      X