Problem in Java Stored Procedure (VERY URGENT)


EJB programming & troubleshooting: Problem in Java Stored Procedure (VERY URGENT)

  1. hey guys,
     Can u pls tell me what is the use of Java Stored Procedure.
    Basically i have got a requirment that i need to create stored procedure which should work in oracle or db2 or sql2000. can i write a java stored procedure which is independent of any database.If any kind of help just mail me on
    kiranrkilledar at rediffmail dot com

    Its very urgent.
    Thankx a lot.
  2. hai,
        as far as i know u cant write db independant code
  3. You cannot write a single stored procedure to work on different databases. The languages are not supported
  4. I undertand the only thing should change is the driver JDBC to the database, but , theorically, the JAVA classes should be the same.
      Maybe the way you make the connection with the database may change.

        Jose R.
  5. Obviously, you cannot connect to all the databases at the same time. But what you can do is create a properties file where you can specify the database driver name, the driver url, username, password, etc.

    Now, you can read from this properties file when you want to connect to the database. All you need to do when changing the database is change the driver name and the database url in the properties file.
  6. Hello Kiran

    I think it is not possible to have same proce which will
    run on oracle and SQL Server .
    So u will have to write 2 diff proce.
    But U can design some classes which will check for the database and then execute appropriate proce in preparestatement.

    All the best