Calling Stored Procedure from JDBC MSSQL

Ok, I have a stored procedure on a MsSQL Server 2000 data base. I need to call it to encrypt/decrypt passwords, my problem is when I run it from Query Analyzer it works fine but not in JDBC land. Below I have included my code. I have read you need to use a callable statement, but my query has a proc call embedded in it, not just a proc call. Anyone know how this would be accomplished?
THanks in Advance
try {
               // create an insert query
               StringBuffer query = new StringBuffer();
               // add strings and variables to query
               query.append("INSERT INTO ");
               query.append("users (Company, FirstName, LastName, Username, ");
               query.append("Password, Email) ");
               query.append("values(");
               query.append("'" + form.getCompany() + "', ");
               query.append("'" + form.getFirstName() + "', ");
               query.append("'" + form.getLastName() + "', ");
               query.append("'" + form.getUsername() + "', ");
               query.append("dbo.fn_sys_encryptpwd('" + form.getPassword() + "', '" + key + "'), " );
               query.append("'" + form.getEmail() + "')");
               // get the datasource from the From the context
               DataSource dataSource = ResourceLocator.getRCDataSource();
               // open a connection
               Connection conn = dataSource.getConnection();
               // make a statement and execute it
               CallableStatement statement = conn.prepareCall(query.toString()) ;
               //Statement statement = conn.createStatement();
               statement.execute();
               // Insert has been performed...destroy the statement and connection.
               statement.close();
               conn.close();
          }

I tried with Statement first then I tried with the PreparedStatement, but neither one worked. I have inlcuded part of the stackTrace to give you an idea of my problem
Thanks
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'dbo.fn_sys_encryptpwd'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(
Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Sour
ce)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType
(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(Deleg
atingPreparedStatement.java:168)
at com.retailcode.web.data.dao.LoginDAO.createLogin(LoginDAO.java:81)
at com.retailcode.web.submit.SubmissionServlet.postRegister(SubmissionSe
rvlet.java:226)
at com.retailcode.web.submit.SubmissionServlet.doPost(SubmissionServlet.
java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Unknown Source)

Similar Messages

  • Urgent! Call stored procedure from jdbc vs. call from sqlplus?

    Hello I met a strange problem when using JDBC (to Oracle). I have a stored procedure mypack.myproc, which updates a table (only one row and one column in the table). I found that when I called the procedure directly from sql*plus, like:
    ==========
    BEGIN
    mypack.myproc;
    END;
    ==========
    the value is 2, which is correct.
    However, if I call the procedure from with in java via jdbc, the value become 591 (which is ridiculous), the jdbc call looks like:
    ================
    cstmt = con.prepareCall("{call mypack.myproc}");
    cstmt.executeUpdate();
    con.commit();
    ================
    This is really wield, Any idea?
    Thanks

    Hey buddy, it's you again. Just let you know that you are right. The problem is caused by mis-match between jdbc date and oracle date (that procedure is used to do some date calculation). My co-worker suggested me to add this statement in the procedure, and it did solved problem:
    ================
    DBMS_SESSION.SET_NLS( 'NLS_DATE_FORMAT', '''DD-MON-RRRR''' );
    ================

  • Invalid Object when Calling Stored Procedure from JDBC Adapter

    JDBC Outbound adapter in XI 2.0 connected to SQL Server.  I've coded my mapping to format the XSL mapping properly but the Adapter appears to not be able to find the Stored Procedure.  Error message returned is "Invalid Object spStoredProcedureName".
    Does anybody have any clue as to what I'm missing???

    I know this is trivial, but did you use the "full" name of the SP as <schema>.<procname>???
    HTH

  • Calling Stored Procedure from JDBC Adapter

    Hello,
    I am Updating a SQL Server Table using JDBC Adapter.
    Now I have multiple input rows and the procedure needs to be called for each set.
    Do I need to use multimapping for this or just generating multiple <b>Statement</b> node will solve?
    Also For this will there is any knows/ forseen problem (like Transaction handling) that I need to take care of?
    Thanks and Regards,
    Himadri
    Message was edited by:
            Himadri Chakraborty

    Himadri,
    You can just create multiple statement nodes in one message.
    I am not aware of any known or foreseen issues with this approach.
    Kind regads,
    Koen

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Calling stored procedure from EJB in JSever

    I have some trouble to call stored procedure from EJB deployed to JServer on Oracle8i (815).
    I have been able to sucessfully test the stored procedure using thin client JDBC driver. But when I user the default connection in JServer, the stored procedure never got called. Is there any restriction of EJB in JServer?
    Thanks
    null

    Thanks man! that was a great help. looks like i am almost there. i created those items t obe hidden.
    now i am passing three parameters to the procedure. my url for that column value looks like this,
    javascript:P65_PARTITION_ID=#PARTITION_ID#;P65_DBC=#DBC#;P65_FILE_ID=#FILE_ID#;doSubmit('Sku_Save');
    the #DBC# parameter is a name of the person that has spaces(firstname lastname). i am getting a javascript error saying,
    Line: 1
    Char: 37
    Error:Expected ';'
    i see that char 37 is the space after firstname.
    any idea how i should get rid of this error.
    Also, as you have been very helpful, a question further beyond :). the above procedure will return a OUT varchar parameter. i guess i have to create another item for that. how do i read it and display just below my report as text.
    Thanks Again!

  • How to use @jws:sql call Stored Procedure from Workshop

    Is there anyone know how to use @jws tag call Sybase stored procedure within
    Workshop,
    Thanks,

    Anurag,
    Do you know is there any plan to add this feature in future release? and
    when?
    Thanks,
    David
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]..
    David,
    In the current release, we do not support calling stored procedures from a
    database control. You will have to write JDBC code in the JWS file to call
    stored procedures.
    Regards,
    Anurag
    Workshop Support
    "David Yuan" <[email protected]> wrote in message
    news:[email protected]..
    Anurag,
    I know how to use DB connection pool and create a db control with it. In
    fact, we have created a Web Service with the db control using plain SQL
    in
    @jws:sql. However, my question here is how to use @jws tag in Weblogic
    Workshop to create a Web Services based on Sybase stored procedure orany
    Stored Proc not plain SQL.
    Thanks,
    David
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]..
    David,
    You can use a database control to obtain a connection from any JDBC
    Connection Pool configured in the config.xml file. The JDBC Connectionpool
    could be connecting to any database, the database control is
    independent
    of
    that.
    Regards,
    Anurag
    Workshop Support
    "David Yuan" <[email protected]> wrote in message
    news:[email protected]..
    Is there anyone know how to use @jws tag call Sybase stored
    procedure
    within
    Workshop,
    Thanks,

  • Calling stored procedure from DAC

    Anyone has instructions on calling stored procedures from DAC. If I had a stored procedure called gary.refresh, where would I put that in the DAC. How do I specify the database that my stored procedure is in.. There doesn't seem to be any examples of this in the documentation for DAC administration
    Edited by: user8092687 on Jun 6, 2011 7:51 AM

    You have 3 options.
    Option 1:
    Create an SQL file that runs the stored proc. For instance, if
    your stored proc is called "aggregate_proc" you would create a
    file called aggregate_proc.sql that has the syntax to run the
    stored proc. Put the file in the CustomSQLs directory that hangs
    off the DAC main directory. Then, in the DAC, create a new task
    (Execution Type = SQL File). The command for Incremental Load
    would be aggregate_proc.sql.
    Option 2:
    Create an Informatica mapping (and corresponding workflow) that
    runs the stored proc. Then create a DAC task (Execution type Informatica) that runs the workflow.
    Option 3 :
    Directly mention Schema.procedure name in the DAC task
    Hope this helps,
    - Amith

  • Weird Problem calling Stored Procedure using JDBC

    Scenario is..
    I have J2EE application and calling stored procedure using JDBC.
    My application connects to instance "A" of testDB.
    Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
    In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
    The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
    Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
    Thanks

    Hi,
    I assume these are PL/SQL packages and that the changes are made at the package specification level?
    If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
    Kuassi http://db360.blogspot.com

  • How to call stored procedure from Pro*C

    How to call stored procedure from Pro*C ?
    my system spec is SuSE Linux 9.1, gcc version : 3.3.3, oracle : 10g
    my Pro*C code is the following..
    EXEC SQL EXECUTE
    begin
    test_procedure();
    end;
    END-EXEC;
    the test_procedure() has a simple update statement. and it works well in SQL Plus consol. but in Pro*C, there is a precompile error.
    will anybody help me what is the problem ??

    I'm in the process of moving C files (with embedded SQL, .PC files) from Unix to Linux. One program I was trying to compile had this piece of code that called an Oracle function (a standalone), which compiled on Unix, but gives errors on Linux:
    EXEC SQL EXECUTE
    BEGIN
    :r_stat := TESTSPEC.WEATHER_CHECK();
    END;
    END-EXEC;
    A call similar to this is in another .PC file which compiled on Linux with no problem. Here is what the ".lis" file had:
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Error at line 193, column 5 in file weather_check.pc
    193 BEGIN
    193 ....1
    193 PCC-S-02346, PL/SQL found semantic errors
    Error at line 194, column 8 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .......1
    194 PLS-S-00000, Statement ignored
    Error at line 194, column 18 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .................1
    194 PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    System default option values taken from: /oracle_client/product/v10r2/precomp/ad
    min/pcscfg.cfg
    Error at line 194, column 18 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .................1
    PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Error at line 194, column 8 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .......1
    PLS-S-00000, Statement ignored
    Semantic error at line 193, column 5, file weather_check.pc:
    BEGIN
    ....1
    PCC-S-02346, PL/SQL found semantic errors

  • Calling stored procedures from entity object and application module

    Hello
    I've put in place an EntiyImpl base class containg helper methods to call stored procedures.
    I now need to call stored procedures from the application module.
    Apart from creating an application module base class and duplicating the helper method code is there a way
    to share the helper methods for calling stored procedures between the entity impl and application module impl ?
    Regards
    Paul

    Does the helper code depend on features of a particular entity object instance, beyond its database transaction?
    If so, I'm not sure I see how it could be used from an application module class.
    If not, here's what you do:
    Step 1:
    Parametrize the database transaction--you might even want to. So instead of
    protected myHelperMethod(Object someParam) {
    DBTransaction trans = getDBTransaction();
    change this to
    protected myHelperMethod(DBTransaction trans, Object someParam) {
    Step 2: make the method public and static--once you parameterize the DBTransaction, you should be able to do this.
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    Step 3: Remove the method from your EntityImpl base class into a utility class:
    public abstract class PlSqlUtils {
    private PlSqlUtils() {}
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    When you want to call the method from an application module, entity object, or even view object class, call
    PlSqlUtils.myHelperMethod(getDBTransaction(), paramValue);
    Unlike Transaction.executeCommand(), this lets you provide functionality like setting procedure parameter values, retrieving OUT parameter values, etc.
    Hope this helps,
    Avrom

  • Calling Stored Procedures from Discoverer

    Does anyone know if I can call stored procedures from Discoverer? I know it supports Registered PL/SQL functions. If yes, can I find any documentation. Any information will be very helpful.
    Thanks in advance!
    Ning

    One way I can think of to do that would be to use function with pragma restrict references. You can then use the function as a column in a SQL query to make a folder in Discoverer.

  • Calling a DB2 stored procedure from SAP MSSQL environment (linkedserver)

    Hi All
    We are strugling to call 'stored procedures' on DB2 via linkedserver. We are running db MSSQL.
    When performing regular lookups on DB2 tables we have no problems - but when executing stored procedures - we are getting no answer - what so ever back. Not even an error.
    Should this not be possible?
    Appreciate your help.
    /Bo
    Message was edited by:
            Bo Moeller

    closing

  • Error while calling stored procedure from Java

    Hi Guys,
    How are you everybody? I hope everything is goin fine on your side. I have one issue in PL/SQL while calling below stored procedures from Java.
    Problem Description: We have a stored procedure PROCEDURE BULK_INSERTS (
    V_SESSION_ID_TAB IN T_SESSION_ID_TAB_TYPE,
    V_SERVICE_TYPE_TAB IN T_SERVICE_TYPE_TAB_TYPE,
    V_SERVICE_LOCATION_TAB IN T_SERVICE_LOCATION_TAB_TYPE,
    V_SERVICE_CALL_NAME_TAB IN T_SERVICE_CALL_NAME_TAB_TYPE,
    V_SERVICE_CALL_START_TIME_TAB IN T_SERVICE_CALL_ST_TAB_TYPE,
    V_SERVICE_CALL_END_TIME_TAB IN T_SERVICE_CALL_ET_TAB_TYPE,
    V_SERVICE_CALL_DURATION_TAB IN T_SERVICE_CALL_DUR_TAB_TYPE,
    V_STATUS_TAB IN T_STATUS_TAB_TYPE,
    V_NOTES_TAB IN T_NOTES_TAB_TYPE
    ) and we are getting ora errors while calling this stored procedure from java.
    All tab types are declared locally, at package level.
    Here is error which occur while calling this sp:
    {call BULK_PKG.BULK_INSERTS(?,?,?,?,?,?,?,?,?)}
    And the parameter types we are using are:
    SESSION_ID - NUM_TAB_TYPE
    SERVICE_TYPE - VAR_TAB_TYPE
    SERVICE_LOCATION - VAR_TAB_TYPE
    SERVICE_CALL_NAME - VAR_TAB_TYPE
    SERVICE_CALL_START_TIME - DATE_TIME_TAB_TYPE
    SERVICE_CALL_END_TIME - DATE_TIME_TAB_TYPE
    SERVICE_CALL_DURATION - NUM_TAB_TYPE
    STATUS - VAR_TAB_TYPE
    NOTES - VAR_TAB_TYPE
    And the Exception stack trace is:
    ERROR (com.att.retail.r2d2.persistence.dao.ExternalServiceCallDAO.saveExternalServiceCallInfo(ExternalServi
    ceCallDAO.java:143)@ExecuteThread: '252' for queue: 'weblogic.kernel.Default') {Error attempting to save collected ESC data}
    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_INSERTS'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:944)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3482)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3856)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1373)
    at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:98)
    at com.att.retail.r2d2.persistence.dao.ExternalServiceCallDAO.doBulkInsert(ExternalServiceCallDAO.java:220)
    at com.att.retail.r2d2.persistence.dao.ExternalServiceCallDAO.saveExternalServiceCallInfo(ExternalServiceCallDAO.java:138)
    Please help my guys out of this. I will really appreciate all suggestions and advices.
    Thank you everybody.

    I am trying to pass parameter to test my procedure but it is giving this error : ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 12
    Here is example for my test procedure:
    declare
    v_session_id_tab SESSION_ID_TAB_TYPE;
    v_service_type_tab SERVICE_TYPE_TAB_TYPE ;
    v_service_location_tab SERVICE_LOCATION_TAB_TYPE ;
    v_service_call_name_tab SERVICE_CALL_NAME_TAB_TYPE;
    v_service_call_start_time_tab SERVICE_CALL_ST_TAB_TYPE;
    v_service_call_end_time_tab SERVICE_CALL_ET_TAB_TYPE;
    v_service_call_duration_tab SERVICE_CALL_DUR_TAB_TYPE;
    v_status_tab STATUS_TAB_TYPE;
    v_notes_tab NOTES_TAB_TYPE;
    begin
    v_session_id_tab(1) := 1;
    v_service_type_tab(1) := 'db';
    v_service_location_tab(1) := 'local';
    v_service_call_name_tab(1) := 'Name of call';
    v_service_call_start_time_tab(1) := SYSDATE;
    v_service_call_end_time_tab(1) := SYSDATE;
    v_service_call_duration_tab(1) := 100;
    v_status_tab(1) := 'Z';
    v_notes_tab(1) := 'NOTES';
    BULK_INSERTS (v_session_id_tab,v_service_type_tab, v_service_location_tab,v_service_call_name_tab,v_service_call_start_time_tab,v_service_call_end_time_tab,
    v_service_call_duration_tab, v_status_tab, v_notes_tab);
    end;
    I declare all types at schema level.
    Please give your comments.
    Thank you

  • Calling Stored Procedure from JDeveloper

    Hi All,
    Is it possible to call a Java or PL/SQL Stored Procedure from JDeveloper ?
    can someone give me some code examples?
    HAPPY NEW MILLENIUM
    Rj

    One way, using jdbc against a stored function ( you need to set up the connection... search earlier postings ):
    try
    Statement call= OpenDBConnections.myJdbcConnection.createStatement();
    ResultSet rset=call.executeQuery("SELECT getCustomerName('"+
    tmpCustomerNumber+
    "') AS CUST_NAME FROM DUAL");
    rset.next();
    customerName_tf.setText(rset.getString("CUST_NAME"));
    rset.close();
    call.close();
    catch (SQLException esql)
    System.out.println(esql.toString());
    For a stored procedure returning a resultset:
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try
    CallableStatement call =
    OpenDBConnections.myJdbcConnection.prepareCall
    ("{? = call CRR_GET_PART_HISTORY(?)}");
    call.registerOutParameter(1,OracleTypes.CURSOR);
    call.setString(2,partNumberHist_tf.getText().toString());
    call.execute();
    OracleResultSet rset=(OracleResultSet)call.getObject(1);
    /* use caching result set cuz it is non scrollable stored proc result */
    model = new CachingResultSetTableModel(rset);
    history_tbl = new JTable(model);
    historyStatus_tf.setText(history_tbl.getRowCount()+" matching records found.");
    jScrollPane1.getViewport().add(history_tbl, null);
    rset.close();
    call.close();
    catch (SQLException esql)
    System.out.println(esql.toString());
    On the stored procedure side one sets up a ref cursor... you'll need to define a
    type sqlcur is REF cursor;
    end;
    Again... do a search on this group and you'll find a wealth of info ( and gotchyas ).

Maybe you are looking for

  • How do I check that the flashplayer installed onto my Mac is a geniune Flashplayer?

    System Using Macbook Pro 2010, with OS X Mavericks 10.9.03 Version of flash 14.0.0.125 (updated by the official website "get adobe . com" ) After getting popups from http update4.new-flash-players.us on some occaision (some video sites as dailymotion

  • Exclusive connection iPad to Apple TV

    We use iPads and Apple TVs at my University for presentations.  I find however that a few minutes after I make the connection, it drops out, and I suspect that someone else on the network is accidentally (or otherwise) making the connection to the sa

  • Can't delete iphoto images from hard drive

    I transferred my iphoto library onto my external hard drive in order to save some space. When I moved the existing library of images to trash in iphoto it deleted it from iphoto but didn't free up any space on my hard drive. I have tried to find thes

  • Error in netweaver BI query designer

    Hi, When we login into BI3 and select Query designer it shows error as given in attached document. I have checked all the services and restarted it bbut still doesnot work. Kindly advice what exactly can be done for this. With Regards

  • Why do we need to create an emergency file?

    Please see the link  http://help.sap.com/saphelp_47x200/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm Why do we need to create an emergency file?