Java.sql.SQLException: execute() never called java.sql.SQLException: execut

Hi,
I am having problem in with depolying application developed using creator on Tomcat5.0. I am using sybase for connection
MY JNDI settigns are correct. I have tried using
1. Sun creator drvier class
or
2. JConnection6_0
But am having no luck so far.
Here is the stack trace
java.sql.SQLException: execute() never called
at com.sun.sql.rowset.CachedRowSetXImpl.checkExecuted(CachedRowSetXImpl.java:269)
at com.sun.sql.rowset.CachedRowSetXImpl.next(CachedRowSetXImpl.java:1423)
at webreporting.security.LoginValidator.authorizeUser(LoginValidator.java:61)
at webreporting.Page1.button1_action(Page1.java:308)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChai
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:1

java.sql.SQLException: execute() never called
at com.sun.sql.rowset.CachedRowSetXImpl.checkExecuted(CachedRowSetXImpl.java:269)
at com.sun.sql.rowset.CachedRowSetXImpl.next(CachedRowSetXImpl.java:1423)
at webreporting.security.LoginValidator.authorizeUser(LoginValidator.java:61)You can't call cachedRowSet.next() until after you've executed your query. That's what the stack trace seems to say.
cachedRowSet.execute() retrieves the rows from the database.
next() lets you interate through the retrieved rows (aka the ResultSet).

Similar Messages

  • Question about having a master sql scrpit/file that calls other sql files

    I know that in SQL Plus, the following works:
    master.sql:
    @script1.sql
    @script2.sql
    @scriptn.sql
    My problem is, I'm using the sql maven plugin and the jdbc driver doesn't seem to like the @script.sql syntax. So the question is two-fold. Is it possible to get this master script behavior using the jdbc driver and not SQL Plus. Second, is the @script.sql syntax, specific to SQL Plus?
    Thanks!
    Justin

    The @<<script>> syntax is specific to SQL*Plus. I'm not familiar with the "sql maven plugin", so I have no idea whether it has some analogous syntax for calling scripts in other files or not. The JDBC API works just with SQL statements, not scripts, so whatever application (I'm guessing SQL Maven?) that is using the JDBC driver has to interpret the @<<script>> syntax.
    Justin

  • Whether java run in UNIX can call java run in win NT?

    Hi,
    I want to create a Java class run in Unix and this class will create a socket call to another Java class which is run in Window NT platform, Is it possible to do that ?
    Is it have same java coding to have socket call in UNIX enviroment ? when the data is text string , is it possible for the java program in window NT read the same text string after it receive it from the socket ?
    Thanks a lot

    It should be entirely possible.
    If you wrap the streams in an ObjectInputStream and ObjectOutputStream you can just send and recieve a string as a Java object via serialization.

  • Fails when executing job called syspolicy_purge_history (SQL Server 2012)

    Hi friends i have the following  problem
    The job syspolicy_purge_history  of my database engine failed, specifically on the third step called "Erase Phantom System Health Records" that executes a powershell.  This is the sentence that executes (All job syspolicy_purge_history
    on any SQL 2012 has the same code):
    if ('$(ESCAPE_SQUOTE(INST))' -eq 'MSSQLSERVER') {$a = '\DEFAULT'} ELSE {$a = ''};
    (Get-Item SQLSERVER:\SQLPolicy\$(ESCAPE_NONE(SRVR))$a).EraseSystemHealthPhantomRecords()
    .  When i see the job history i get the following:
    Message
    Executed as user: NT Service\SQLSERVERAGENT. The job script encountered the following errors. These errors did not stop the script:  A job step received an error at line 1 in a PowerShell script. The corresponding line is 'import-module SQLPS  -DisableNameChecking'.
    Correct the script and reschedule the job. The error information returned by PowerShell is: 'The specified module 'SQLPS' was not loaded because no valid module file was found in any module directory.  '  A job step received an error at line 2 in
    a PowerShell script. The corresponding line is '(Get-Item SQLSERVER:\SQLPolicy\SRV01236$a).EraseSystemHealthPhantomRecords()'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Cannot find drive. A drive with the
    name 'SQLSERVER' does not exist.  '  A job step received an error at line 2 in a PowerShell script. The corresponding line is '(Get-Item SQLSERVER:\SQLPolicy\SRV01236$a).EraseSystemHealthPhantomRecords()'. Correct the script and reschedule the job.
    The error information returned by PowerShell is: 'You cannot call a method on a null-valued expression.  '.  Process Exit Code -1.  The step failed.
    Aditionally i tested putting the policies in powershell like unrestricted (like i see on a blog). but it didn't work.
    My SQL version is 2012 Standard SP1 X64
    Please help me with this
    Thanks for your help
    Greetings
    Aleds

    Thanks for your help princekumar8 and gona_david
    Hello Gona_david,  You are right, when i execute the powershell sentence Get-Module -ListAvailable
    the SQLPS module doesn't appear. 
    Look i have another SQL Server 2012 in another server, but this is patched on SP2 and the syspolicy_purge_history here runs OK.  Also when i execute the powershell, the SQLPS appears in the list.
    So, my question is: If i patch my server SQL Server 2012 with the error from SP1 to SP2, is Possible that the error will get away? In fact, Wouldn't be yet necessary runs the SQL install? 
    Basically what you recommend me in this case?
    Thanks in advance 
    Greetings 
    Aleds

  • How stored procedure get executed when called from java

    When we create a stored procedure or function in oracle, it is compiled and stored there. From java when we call them no compilation is performed its a simple call. When a function or stored procedure is invoked from multiple instance of java objects(for a single session), does the stored procedure clone it self so that it can be called by different java objects which I think not possible at all. In such cases when one java object is interacting with the stored procedure, does other java objects go on a wait state. What happens if sessions are different.
    Please help.

    >
    does oracle creates multiple instance of a particular stored procedure for different sessions or connections. if not then there might be some kind of waiting principle followed.. what happens exactly
    >
    What happens exactly is detailed in Chap. 14 Memory Architecture ni the Database concepts doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10713/memory.htm#i21266
    The code is shared but the data isn't (see the lone exception to this below).
    See the section on the Library Cache
    >
    Program Units and the Library Cache
    The library cache holds executable forms of PL/SQL programs and Java classes. These items are collectively referred to as program units.
    The database processes program units similarly to SQL statements. For example, the database allocates a shared area to hold the parsed, compiled form of a PL/SQL program. The database allocates a private area to hold values specific to the session that runs the program, including local, global, and package variables, and buffers for executing SQL. If multiple users run the same program, then each user maintains a separate copy of his or her private SQL area, which holds session-specific values, and accesses a single shared SQL area.
    >
    The exception is when code uses the SERIALLY_REUSABLE pragma. In that case the memory for package state is in the SGA and users do not have their own copy in their UGA.
    See the SERIALLY_REUSABLE pragma in the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/seriallyreusable_pragma.htm
    >
    The global memory for serially reusable packages is pooled in the System Global Area (SGA), not allocated to individual users in the User Global Area (UGA). That way, the package work area can be reused. When the call to the server ends, the memory is returned to the pool. Each time the package is reused, its public variables are initialized to their default values or to NULL.
    Serially reusable packages cannot be accessed from database triggers or other PL/SQL subprograms that are called from SQL statements. If you try, the database generates an error.

  • Problems with cached rowsets:  execute() not called

    I'm using sun studio creator and am trying to use a cached rowset. The code for creating it and accessing it has been created by studio creator.
    The CachedRowSetXImpl is created by the session bean _init method (see below) and is accessed via the jsf web page via a value= attribute on a data table.
    The problem is is that the first time the cached rowset is accessed, it generates the error 'java.sql.SQLException execute() never called. After this is works properly. I've already posted this iin the JSF forum, but didn't get a response. Any ideas?
    private void _init() throws Exception {
    System.err.println ( ClassName + " _init start");
    arg_info_prvdrRowSet.setDataSourceName("java:comp/env/jdbc/isisdev1");
    arg_info_prvdrRowSet.setCommand("SELECT * FROM ISIS_APP.ARG_INFO_PRVDR");
    arg_info_prvdrRowSet.setTableName("ARG_INFO_PRVDR");
    System.err.println ( ClassName + " _init end");
    private CachedRowSetXImpl arg_info_prvdrRowSet = new CachedRowSetXImpl();
    public CachedRowSetXImpl getArg_info_prvdrRowSet() {
    System.err.println ( ClassName + " getArg_info_prvdrRowSet start*****");
    try {
    System.err.println ( ClassName + " Table Name = " +
    arg_info_prvdrRowSet.getMetaData().getTableName(1));
    arg_info_prvdrRowSet.first();
    } catch (Exception Err) {
    System.err.println ( ClassName + " Error is " + Err.getClass().getName() + " " + Err.getMessage() );
    System.err.println ( ClassName + " getArg_info_prvdrRowSet end");
    return arg_info_prvdrRowSet;
    }

    Did you get the solution for this. if you can get please, tell me .
    i m struggling like hell. everything ok. I cannot get the rows. when i deploy in Tomcat 5.5
    con = DriverManager.getConnection("jdbc:mysql://localhost/seafood?user=root&password=");
    categoryRowSet.setDataSourceName("java:comp/env/jdbc/sea");
    //categoryRowSet.getConnection("jdbc:mysql://localhost/seafood?user=root&password=");
    categoryRowSet.setUrl("jdbc:mysql://localhost:3306/seafood");
    categoryRowSet.setUsername("root");
    categoryRowSet.setPassword("");
    //categoryRowSet.execute(con);
    categoryRowSet.setCommand("SELECT * FROM category");
    categoryRowSet.setTableName("category");
    categoryRowSet.execute();

  • Java.sql.SQLException: Internal Error with oracle.sql.ARRAY getArray()

    hi,
    I am having having problems with the getArray() of oracle.sql.ARRAY.
    Here are the details:
    Oracle Database - 9.2.0.6. The JDBC driver used -10.2.0.1 jar.(the latest available).
    I am calling a stored procedure from java, that has out param as a collection (VARRAY) of a user defined type.
    The stored procedure works fine, if the user/schema used to connect,contains actual type, and i am able to extract the user defined object from the oracle.sql.ARRAY, via getArray().
    But if i use a different user to connect which has public synonyms and execute rights to the actual type, i get the following error:
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    The problem is happening because we have 2 different users to connect to the database. one is the dba user, which contains all the types, packages and other one the application user, which we are supposed to use, to connect via java. This application user does have access to types via public synonym, but it gives the above mentioned error.
    Please help :(.
    Regards,
    Gaurav.

    Hi avi,
    Even I am getting the same error inspite of preceding the type name with the same user who has created the type.
    It has displayed the array length.When I am trying to fetch each array, I am getting the error.
    ARRAY simpleArray = (ARRAY) cs.getObject(3);          
    System.out.println("Array is of length " + simpleArray.length());          ********************** The above stmt prints 2 records ******************
    But it goes to exception in the foll stmt..
    Object [] objArrStructArray = null;
    try{
         objArrStructArray = (Object[]) simpleArray.getArray();
    }catch(SQLException e){
         e.printStackTrace();
    Do u know abt this?
    The foll is the error which I am getting.
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:353)
         at com.telstra.plo.data.NetworkDAO.findCablesInBuffer(NetworkDAO.java:730)
         at com.telstra.plo.data.NetworkDAOTest.testFindCablesInBuffer(NetworkDAOTest.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Thanks
    Archana

  • How to call sql procedure with parameter from java

    Hello,
    i am trying to call one sql procedure with two parameters from java.
    the first parameter is In parameter, the second is OUT.
    the return value of this java method should be this second parameter value.
    the following is my java code:
    protected String getNextRunNumber() {
         String runnumber=null;
         String sql = "{call APIX.FNC_SST_EXPORT.GET_NEXT_RUNNUMBER (?,?)}";
    CallableStatement state = null;
    try{
         Connection con= getDatabaseConnection();
         state = con.prepareCall(sql);
         state.setString(1, m_appKeyExport);
         state.registerOutParameter(2,Types.NUMERIC,0);
         state.execute();
    ResultSet resultR = (ResultSet)state.getObject(2);
         while (resultR.next()) {
              runnumber=resultR.getBigDecimal(1).toString();
    catch (SQLException e){System.out.println("You can not get the export next run number properly");}
    return runnumber;
    i got error message like:
    java.lang.ClassCastException: java.math.BigDecimal
    As far as i knew, if the parameter is number or decimal, we should give also the paramer scale to the method: state.registerOutParameter(), but i still get this error message.
    Please help me to solve this problem.
    Thanks a lot.

    state.execute();
    i try to use debug to find the problem, in this line, i saw
    OracleCallableStatement(OraclePreparedStatement).execute() line: 642 [local variables unavailable]
    is this the problem?

  • How to create and execute PL/SQL program or Procedure from Java (JDBC)

    hi all,
    user will enter the Pl/Sql program from User-Interface. that program has to be create in DB and execute that.
    due to some confusions, how to execute this from Java, i (user) entered the same logic through a Procedure.
    my Java code is
    Statement st = con.createStatement();
    Statement.execute(procedure_query); // procedure name is myPro
    CallableStatement cs = con.prepareCall("{call myPro}");
    (as given in SUN docs - http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html)
    but its not creating the procedure.
    and i tried to run a procedure (which is already created) with CallableStatement, and this is also not working.
    how to get this.
    thanks and regards
    pavan

    Hi,
    SInce the PL/SQL block is keyed in dynamically, you probably want to use the anonymous PL/SQL syntax for invoking it:
    // begin ? := func (?, ?); end; -- a result is returned to a variable
    CallableStatement cstmt3 =
    conn.prepareCall(“begin ? := func3(?, ?); end;”);
    // begin proc(?, ?); end; -- Does not return a result
    CallableStatement cstmt4 =
    Conn.prepareCall(“begin proc4(?, ?); end;”);
    SQLJ covered in chapter 10, 11, and 12 of my book furnish a more versatile dynamic SQl or PL/SQL mechanisms.
    Kuassi
    - blog http://db360.blogspot.com/
    - book http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html

  • PL/SQL Procedure Calling Java Host Command Problem

    This is my first post to this forum so I hope I have chosen the correct one for my problem. I have copied a java procedure to call Unix OS commands from within a PL/SQL procedure. This java works well for some OS commands (Eg ls -la) however it fails when I call others (eg env). Can anyone please give me some help or pointers?
    The java is owned by sys and it looks like this
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ExecCmd" AS
    //ExecCmd.java
    import java.io.*;
    import java.util.*;
    //import java.util.ArrayList;
    public class ExecCmd {
    static public String[] runCommand(String cmd)
    throws IOException {
    // set up list to capture command output lines
    ArrayList list = new ArrayList();
    // start command running
    System.out.println("OS Command is: "+cmd);
    Process proc = Runtime.getRuntime().exec(cmd);
    // get command's output stream and
    // put a buffered reader input stream on it
    InputStream istr = proc.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(istr));
    // read output lines from command
    String str;
    while ((str = br.readLine()) != null)
    list.add(str);
    // wait for command to terminate
    try {
    proc.waitFor();
    catch (InterruptedException e) {
    System.err.println("process was interrupted");
    // check its exit value
    if (proc.exitValue() != 0)
    System.err.println("exit value was non-zero: "+proc.exitValue());
    // close stream
    br.close();
    // return list of strings to caller
    return (String[])list.toArray(new String[0]);
    public static void main(String args[]) throws IOException {
    try {
    // run a command
    String outlist[] = runCommand(args[0]);
    for (int i = 0; i < outlist.length; i++)
    System.out.println(outlist);
    catch (IOException e) {
    System.err.println(e);
    The PL/SQL looks like so:
    CREATE or REPLACE PROCEDURE RunExecCmd(Command IN STRING) AS
    LANGUAGE JAVA NAME 'ExecCmd.main(java.lang.String[])';
    I have granted the following permissions to a user who wishes to run the code:
    drop public synonym RunExecCmd
    create public synonym RunExecCmd for RunExecCmd
    grant execute on RunExecCmd to FRED
    grant javasyspriv to FRED;
    Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/bin/env','execute');
    commit
    Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/opt/oracle/live/9.0.1/dbs/*','read, write, execute');
    commit
    The following test harness has been used:
    Set Serverout On size 1000000;
    call dbms_java.set_output(1000000);
    execute RunExecCmd('/bin/ls -la');
    execute RunExecCmd('/bin/env');
    The output is as follows:
    SQL> Set Serverout On size 1000000;
    SQL> call dbms_java.set_output(1000000);
    Call completed.
    SQL> execute RunExecCmd('/bin/ls -la');
    OS Command is: /bin/ls -la
    total 16522
    drwxrwxr-x 2 ora9sys dba 1024 Oct 18 09:46 .
    drwxrwxr-x 53 ora9sys dba 1024 Aug 13 09:09 ..
    -rw-r--r-- 1 ora9sys dba 40 Sep 3 11:35 afiedt.buf
    -rw-r--r-- 1 ora9sys dba 51 Sep 3 09:52 bern1.sql
    PL/SQL procedure successfully completed.
    SQL> execute RunExecCmd('/bin/env');
    OS Command is: /bin/env
    exit value was non-zero: 127
    PL/SQL procedure successfully completed.
    Both commands do work when called from the OS command line.
    Any help or assistance would be really appreciated.
    Regards,
    Bernard.

    Kamal,
    Thanks for that. I have tried to use getErrorStream and it does give me more info. It appears that some of the commands cannot be found. I suspected that this was the case but I am not sure about how this can be as they all appear to reside in the same directory with the same permissions.
    What is more confusing is output like so:
    SQL> Set Serverout On size 1000000;
    SQL> call dbms_java.set_output(1000000);
    Call completed.
    SQL> execute RunExecCmd('/usr/bin/id');
    OS Command is: /usr/bin/id
    exit value was non-zero: 1
    id: invalid user name: ""
    PL/SQL procedure successfully completed.
    SQL> execute RunExecCmd('/usr/bin/which id');
    OS Command is: /usr/bin/which id
    /usr/bin/id
    PL/SQL procedure successfully completed.
    Regards,
    Bernard

  • Jdbc NullPointerException calling pl/sql procedure from java

    Hi.
    Getting the following exception calling a plsql procedure from jdbc.
    - Jdbc version is 10.2.0.2, but it also happens running several other variants, including 10.1.0.5.0.
    - Application is running in Weblogic 8.1.3 (8.1 SP 3).
    The procedure call itself has 2 in/out parameters which are tables (actually just 1 dimensional arrays), which I'm suspecting has something to do with the problem. I can successfully call this procedure using a plsql developer tool with the same bind parameters.
    Any ideas?
    Exception encountered while executing PL/SQL procedure MVT_Web_Inquiry.ShowInquiry:
    java.lang.NullPointerException at oracle.jdbc.driver.T4CTTIiov.processRXD([Loracle.jdbc.driver.Accessor;I[B[C[SILoracle.jdbc.driver.DBConversion;[B[B[[Ljava.io.InputStream;[[[B[[Loracle.jdbc.oracore.OracleTypeADT;Loracle.jdbc.driver.OracleStatement;[B[C[S)[Loracle.jdbc.driver.Accessor;(T4CTTIiov.java:139)
    at oracle.jdbc.driver.T4C8Oall.receive()V(T4C8Oall.java:521)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(ZZZZ)V(T4CCallableStatement.java:215)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(Z)V(T4CCallableStatement.java:1119)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V(OracleStatement.java:1278)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I(OraclePreparedStatement.java:3446)
    at oracle.jdbc.driver.OraclePreparedStatement.execute()Z(OraclePreparedStatement.java:3552)
    at oracle.jdbc.driver.OracleCallableStatement.execute()Z(OracleCallableStatement.java:5261)
    at weblogic.jdbc.wrapper.PreparedStatement.execute()Z(PreparedStatement.java:70)
    at
    [snip]

    OK... I figured it out.
    Apparently, this error happens when you forget to register the output part of an in/out parameter. I would have hoped for better error messaging, but oh well.
    -ed-

  • Does Java support mutliple sql statements in one call?

    statment.executeUpdate("DROP DATABASE IF EXISTS diy55;CREATE DATABASE IF NOT EXISTS diy55 DEFAULT CHARACTER SET utf8;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX,USAGE on diy55.* TO 'diy55'@'localhost' identified by 'diy55';FLUSH PRIVILEGES;");Java seemes doesn't support multiple sql statements in one call, just like PHP mysql_query(), is it?

    Then just extend the java.sql.Statement to your own Statement class and write logic which splits the given query at the right places and executes them one by one.
    That the mysql_query() already has it built-in wouldn't say that it isn't possible in Java. Comparing with PHP is a bit pointless, it is a completely different language.

  • Call java method from pl/sql

    Hello,
    i have library written in java and i need call one method from this lib in pl/sql. it's returning string. Is it possible? If, yes can you direct me to some docs about this topic? We have oracle version 8 and 10.
    Thanks a lot.

    i think java support was added to oracle from 8i. is you package is in the form of jar file or java code.?
    you can you jdeveloper the best one i found for writing java and sqlj stored procedures
    you can use loadjava here is a cut and paste from a example i have on my system
    REM Server-side translation, execution of SQLJ program
    REM
    REM Environment setup:
    REM - have sqlj and javac in your PATH
    REM - SQLJ libaries in your CLASSPATH
    REM
    REM In the directory having the SQLJ demo for the server,
    REM execute the following commands
    REM Drop any previously-loaded demo classes
    sqlplus scott/tiger @Dropl
    REM Load the SQLJ source directly
    call loadjava -oci8 -resolve -force -user scott/tiger ServerDemo.sqlj
    REM Publish SQL wrapper and run the demo on the server using SQL*Plus
    sqlplus scott/tiger @Run.sql
    REM In sqlplus, it should print
    REM Hello! I'm SQLJ in server!
    REM Today is <date>

  • How to call PL-SQL script/stored procedure from Java?

    Assume I want to call a PL-SQL stored procedure from external Java program.
    How can I do this?
    Is there a simple "Hello world" example for this?
    Peter

    This forum is for Oracle only not for java
    Ug

  • Calling java from pl/sql in oracle 10g?its very urgent.

    Hi Friends,
    i hve simple java code:
    class Hell
    public static String Hello()
    return"hello world";
    & compile this code using javac & loaded Hell.class in to database using this command
    c:\>loadjava -user chandru/shekar@pulser c:\Hell.class
    & i wrote pl/sql like:
    CREATE OR REPLACE FUNCTION Hell RETURN String as language java name 'Hell.Hello() return java.lang.String';
    i will compile the code & run but at that time this error i am getting:
    ORA-29516: Aurora assertion failure: Assertion failure at eox.c:317
    Uncaught exception System error: java/lang/UnsupportedClassVersionError
    I am using oracle 10g.Plzzzzzzzzz help me.Its very important to for me.
    Is any path i hve to set for oracle 10g database.Plz any one help me.
    regards
    shekar

    Hello here is how I solved the problem
    Let us assume that i try to load the file Hello.Java into the user scott.
    public class Hello {
         public static String world() {
              return "hello world";
    1) Dropjava          
    You must drop the java class if you already have loaded the class onto the server.
    dropjava -u scott/tiger Hello.class
    2) load class on server and let the server compile the source code.
    It is necessary to compile the source code on the server when the server and the local machine have different Java versions. To check which Java version there is running on the client machine open a command prompt and write Java -version
    loadjava -user scott/tiger -resolve Hello.java
    3) Publish stored procedure      
    sqlplus scott/tiger@oracle
    CREATE OR REPLACE FUNCTION helloworld RETURN VARCHAR2 AS                LANGUAGE JAVA NAME 'Hello.world () return java.lang.String';
    4)Call stored procedure      
    VARIABLE myString VARCHAR2(20);
    CALL helloworld() INTO :myString;
    PRINT myString;
    RGDS
    Thomas Winterberg

Maybe you are looking for

  • HT201272 I do not have a "Library" button as described in step 4?

    I do not have a "Library" button as described in step 4?

  • Export to .mov leaving artifacts everywhere...

    I have made a simple animation with music, 800ish frames, no actionscript, using CS4 When I export it as a Quicktime Mov it breaks up and leaves artifacts everywhere, I read that the spec of your mac can affect the export but I'm working on a mac pro

  • ACE WAF nCipher implementation

    Hello guys, I need store private keys for encryption private keys saved on HDD on HW keystore. After reading Cisco doc it's not clear for me. Can Anybody explain it for me? I have 3 WAF appliances: - 1x management (ACE-WAF-MGT-LICFX license) - 2x fw

  • Disable AIR 2.6 updates

    Hi all, how would i go about disabling auto-updates for AIR 2.6 is it possible to disable auto-updates in the Registry? I have also read that placing a "file" in the Local Settings\Application Data\Adobe\AIR will disable the auto-updates. I am aware

  • Post to HTML help- strange format, and no QT movies...

    Hi folks, I'm having a little trouble with the "export to HTML" feature of keynote. Specifically, I have a presentation with some very nice animations. I understand that keynote normally doesn't save these as part of the HTML version. OK, I'm fine wi