BEA Weblogic Question:

How do I call Oracle stored procedures that take no parameters?

BEA Weblogic Interview Question
BEA Weblogic Interview Question

Answer:

Here is what we use that works:
CallableStatement cstmt = conn.prepareCall("Begin procName;
END;");
cstmt.execute();

where procName is the name of an Oracle stored procedure. This is standard Oracle SQL syntax that works with any Oracle DBMS. You might also use the following syntax:

CallableStatement cstmt = conn.prepareCall("{call procName};");
cstmt.execute();

This code, which conforms to the Java Extended SQL spec, will work with any DBMS, not just Oracle.


Previous QuestionNext Question
What type of object is returned by ResultSet.getObject()?How do I learn what codesets are available in Oracle?