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')";