Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / May 2005

Tip: Looking for answers? Try searching our database.

How to submit Oracle Requests through Java

Thread view: 
Bhanu - 30 May 2005 17:35 GMT
Hi

I am new to Java. I am trying to submit a Oracle Apps Concurrent
Request from Java. I tried something like this (given below):

 Class.forName("oracle.jdbc.driver.OracleDriver");

 // Step 2. Create a Connection object
 Connection con = DriverManager.getConnection(
   "jdbc:oracle:thin:@hdqofd:1541:ITPJ",
   "apps", "ksl_apps");
 System.out.println("got connection for item cost correction;" );
 // Step 3. Create a Statement object and call its executeUpdate
 // method to insert a record
 Statement s = con.createStatement();
 String sql = "";
 sql =
"FND_REQUEST.SUBMIT_REQUEST('PO','REQIMPORT',NULL,NULL,FALSE,'NOTES',NULL,
'BUYER', NULL, 'No', 'Yes')";
 s.executeQuery(sql);

I dont know how to do it exactly and when I try to run this it is
throwing "java.sql.SQLException: ORA-00900: invalid SQL statement"
exception.
Please let me know how to solve this.

regards
Kumar
and
Bond - 30 May 2005 20:26 GMT
You have an error in your sql statement  :P

If you need help on how to write an SQL statement, refer to
http://www.w3schools.com/sql/
Lexus - 31 May 2005 07:57 GMT
1. If you use stored procedure, recommended this method:

> Statement s = con.createStatement();// incorrect

//
input parameters

PreparedStatement stmt = conn.prepareCall("select * from
YOU_PROCEDURE(?,?)");

stmt.setObject(1, 777); // setInt(...), setString(...), what you want

stmt.setObject(2, 777); // setInt(...), setString(...), what you want

stmt.setObject(n, ...); // setInt(...), setString(...), what you want

ResultSet rst = stmt.executeQuery();

2. You made an error in this string:

> String sql = "";

> sql =
"FND_REQUEST.SUBMIT_REQUEST('PO','REQIMPORT',NULL,NULL,FALSE,'NOTES',NULL,

> 'BUYER', NULL, 'No', 'Yes')";


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.