Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling Oracle BugDB PL/SQL Package Procedures from Application Modules

User_OUD4GJun 14 2012 — edited Jun 15 2012
Hi Experts,
I am using JDev 11g R2.My requirement is as follows:

1.Create a public database link to remote bugDB using the Testing Environment.(Done)
2.Access the data from local database to BugDB using that DB link (Done)
3.Insert/Create a bug using the Create_Bug procedure in the API provided by BugDB(Failed).In the Application ModuleImpl class I have added the following code(Just an Example) to call the API containing a pl/sql procedure which creates a bug in the remote db table.
public void Create_Bug(String Product, String Component, String Subcomponent, String Status) {
CallableStatement st = null ;
try {
StringBuffer str = new StringBuffer();
str.append(" BEGIN ");
str.append(" Bug.Bug_API_V1.Create_Bug@bugtest( ");
str.append(" Product => :1, ");
str.append(" Component => :2, ");
str.append(" BugNo => :3 ");
str.append(" Status => :4 ");
str.append(" ")

str.append(" ); ");
str.append(" END; ");
st =getDBTransaction().createCallableStatement(str.toString(), 1);
st.setString(1, Product);
st.setString(2, Component);
st.setString(3, Subcomponent);
st.setString(4, Status);
st.execute();

} catch (SQLException sqle) {
// TODO: Add catch code
sqle.printStackTrace();
} catch (NumberFormatException nfe) {
// TODO: Add catch code
nfe.printStackTrace();
}
}
4.Added a managed bean to invoke this AppModuleDataControl which stores the value in the remote database.(Failed in this part).

Its not showing any errors in the log but the bug is not created either in the remote database.Could anyone guide me where am I going wrong or what is the better way to handle this requirement.Any suggestion for materials,links or tutorials would be highly appreciated.Thanks in advance.

Regards,
Prasanna
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2012
Added on Jun 14 2012
2 comments
926 views