How to submit Oracle Requests through Java

B

bhanu

Hi

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


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

// Step 2. Create a Connection object
Connection con = DriverManager.getConnection(
"jdbc:eek:racle:thin:mad: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
 
W

Wibble

bhanu said:
Hi

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


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

// Step 2. Create a Connection object
Connection con = DriverManager.getConnection(
"jdbc:eek:racle:thin:mad: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
use "{ call PKG.PROC(...) }", not "PKG.PROC(...)"
if its a procedure.
 
B

Bjorn Abelli

bhanu wrote:
use "{ call PKG.PROC(...) }", not "PKG.PROC(...)"
if its a procedure.


And use...

s.execute(sql);

instead of...

s.executeQuery(sql);


// Bjorn A
 
H

HalcyonWild

....
use "{ call PKG.PROC(...) }", not "PKG.PROC(...)"
if its a procedure.

Is it possible to call this using a Statement. Or you will have to use
a CallableStatement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top