How to call BULK COLLECT using JDBC in JSP?

Hi
I am using BULK COLLECT instead of CURSOR in my Stored Procedure.
How to use these stuff in JDBC.
If i am using CURSOR means
cs.registerOutParameter(1,oracle.jdbc.driver.OracleTypes.CURSOR);
is used.
Which types i have to use?
I am retriving morethan one record using FOR. LOOP in SP and before that
BULK COLLECT is used in SELECT query..
Can you give jsp code for this?
Thanks

you may find related sample jdbc code on otn - http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html
Best regards.

Similar Messages

  • Calling a procedure using JDBC-OCI

    When I use setPlsqlIndexTable for calling a procedure using JDBC-OCI
    ps.setPlsqlIndexTable(1,str,10,str.length,OracleTypes.VARCHAR,8);
    always throw a Exception :
    java.sql.SQLException: Non supported character set: oracle-character-set-832
    at oracle.gss.util.NLSError.throwSQLException(NLSError.java:46)
    at oracle.sql.CharacterSetUnknown.failCharsetUnknown(CharacterSetFactoryThin.java:171)
    at oracle.sql.CharacterSetUnknown.convert(CharacterSetFactoryThin.java:135)
    at oracle.sql.CHAR.<init>(CHAR.java:133)
    at oracle.sql.CHAR.<init>(CHAR.java:157)
    at oracle.jdbc.oracore.OracleTypeCHAR.toDatum(OracleTypeCHAR.java:145)
    at oracle.jdbc.oracore.OracleType.toDatumArray(OracleType.java:145)
    at oracle.jdbc.oracore.OracleTypeCHAR.toDatumArray(OracleTypeCHAR.java:173)
    at oracle.jdbc.driver.OraclePreparedStatement.setPlsqlIndexTable(OraclePreparedStatement.java:2622)
    When can tell me how to solve it? Thanks

    I hava resolve this problem, we must add the
    class nls_charset12.zip to classpath.

  • Stored procedure : how to call SP in sender JDBC adapter for mysql

    HI friends ,
    we have JDBC---->XI--
    >SAP  scenario. For some business requirement, we have to call STORED PROCEDURE , please let me know how to call  SP in sender JDBC adapter for mysql .
    Thanks
    mojib

    Hi Mojib,
    Please create a sample stored procedure like this which contains select statement and in communication channel give
    wite stored procedure name only to sql query statment and in update statement write <test>.
    I am executing this stored procedure successfully.
    Create Proc GetResultX As
    Begin
    Select * From TESTX
    End
    Execute statement for stored procedure is :
    Exec GetResultX
    Regards
    Laxmi Bhushan Jha
    Rewards point if found usful
    I have given same answer to one of the same  thread

  • 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 web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to call java method using jsp

    how to call java method using jsp.....
    anyone can help me.....i having problem here...coz i very new in java and jsp.....
    thanks.....

    keep an eye on this person's thread...they have code there and everything.
    http://forum.java.sun.com/thread.jspa?threadID=777263&tstart=0

  • How to call the form bean value on jsp withthe help of jstl tag

    hi
    all friends
    i am working in struts & i use jstl tag in jsp. i have one problem rise is how to call the form bean value in jsp page by using jstl tag.
    i now how to retrive the value through jsp:logic
    eg. <logic:empty name="userListForm" property="users">
    NO USER FOUND
    </logic:empty>
    see * userListForm mean formbaen name.
    * users means collection object.
    so how can i write above e.g in jstl

    You use the jstl core:if or core:choose combined with the EL:
    <c:if test="${empty users.userListForm}">
    NO USERS FOUND
    </c:if>I suggest you lookup the jsp expression language (EL) using google, it's very powerful.

  • How to call multiple strus actions froma single jsp

    how to call multiple strus actions froma single jsp, and that actions should be automatically called pls help me
    Thanks in advance

    how to call multiple strus actions froma single jsp, and that actions should be automatically called pls help me
    Thanks in advance

  • How to install sccm client on bulk collections using push installation

    Unfortunately I did something and received the following description:-
    How to know/reproduce the following scenario by installing sccm client on bulk collections in SCCM 2012R2? 
    "User ***** requested that the CCRs will be generated for collection “All Windows Client Systems (P0100015), The SMS Provider did not generate CCRs for all the system resources in this collection.
    Possible cause: some system resources are not assigned to the current site, and you chose to insta
    Il clients only on system resources that are
    assigned to current site. 
    Another possible cause: Some system resources do not have Microsoft Windows NT operating system
    or above installed.
    Message ID: 30110"

    Ok. Some of your clients are not covered under any site assignment boundary, hence you are getting that error. Would recommend you to select "Install the client from a specified site" and select the Primary site. If your boundary groups for content
    are configured fine then the client will be installed from the appropriate site for each machine you are pushing the client to.
    -RG

  • Needed help in bulk collect using collections

    Hi,
    I have created a schema level collection like "CREATE OR REPLACE TYPE T_EMP_NO IS TABLE OF NUMBER ;
    will i able to use this in a where clause which involves bulk collect?
    Please share ur thoughts.
    My oracle version is 10g

    user13710379 wrote:
    Will i be able to do a bulk collect into a table using this collection of my sql type?Bulk fetches collects into an array like structure - not into a SQL table like structure. So calling a collection variable in PL/SQL a "+PL/SQL table+" does not make much sense as this array structure is nothing like a table. For the same reason, one needs to question running SQL select statements against PL/SQL arrays.
    As for your SQL type defined - it is a collection (array) of numbers. Thus it can be used to bulk fetch a numeric column.

  • Adding to a Collection using JDBC

    I'm trying to add to a Collection via JDBC but have had no luck with getting the ResultSet into the Collection and would be grateful for some pointers in the right direction in the while (rs.next()) block:
    public void getMembers(BwGroup group) throws CalFacadeException {
         Class.forName("com.mysql.jdbc.Driver");
         String url = "jdbc:mysql://localhost/loginlist";
         Connection conn = null;
         Collection<BwPrincipal> ms = new TreeSet<BwPrincipal>();
          try {
             conn = DriverManager.getConnection(url, "user", "pword");
             PreparedStatement ps = conn.prepareStatement("SELECT * FROM list WHERE list='" + group +"'");
             ResultSet rs = ps.executeQuery();
                while (rs.next()) {
                   BwPrincipal = new bp(rs.getString(1));
                   ms = addAll(bp);
               group.setGroupMembers(ms);
               rs.close();
               ps.close();
               } catch (Exception e){
                e.printStackTrace();
               } finally {
             if (conn != null) {
            conn.close();
        }I'm getting errors regarding incompatible types for the BwPrincipal line and addAll being an unfound symbol (though I had thought that it was a method to add to Collections). If I try to call BwPrincipal as BwPrincipal bp = new bp(rs.getString(1)); then the addAll error disappears but the programme cannot see BwPrincipal as a class. I feel as if I'm going around in circles at the moment.

    BaroqueThoughts wrote:
    As you say, I'm trying to call something along the lines of
    ms= rs.getString(1);but get an incompatible string back. The reading that I had done suggested addAll but I've probably misunderstood in trying to get this to work. If I try
    ms.add(rs)then the compiler doesn't like the add method (add cannot be applied to java.sql.ResultSet)Well it can't. Why did you try that, though? To be honest, if you can't figure this out yet, JDBC is probably a step too far at the moment. Re-visit the basics, because you clearly don't understand them yet, and you'll struggle forever if you carry on down this path as-is

  • How to call web service using J2SE 1.3?

    Dear All,
    i have developed a web service by jdev 10.1.3 (JAX-RPC with web service security
    enabled).
    i generate the ws proxy (jdev 10.1.3) and run it with wsclient_extended.jar (required JDK 1.4.1 or above??).
    but one of my client say he has to use J2SE 1.3.x (as OS=AIX 4.3 that without J2SE
    1.4.x ), could anyone tell me how can generate ws proxy (with supporting
    library) for jdk 1.3.x?
    if oracle don't have such library / tools, any third party tools / library available?
    thank you.
    lsp

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to call text file using Script in Data Integrator

    Dear All,
    Can any one assit me in how to call a text file using script with the help of Data Integrator.
    and one question ?
    M having 32 csv files i want to club thos 32 csv files into one table with the help of Data Integrator, can
    any one assist me.

    mary,
    since you knew the file name ,when clicked in name send to server,read the file and write to servlet outputstream.
    I think this would help you.
    If anything wrong in mycode ..forums will help you further
    BufferedInputStream bis=null;
    BufferedOutputStream bos=null;
    int bytesRead=0;
    byte buff[]=new byte[1024];
    File f=new File(test.txt);
    try{
         bis= new BufferedInputStream(new FileInputStream(f));
         bytesRead=bis.read(buff,0,buff.length);
         if(bytesRead!=-1){
              // create a BufferedOutputStream from ServletOutputStream
              bos=new BufferedInputStream(response.getOutputStream());
              do{
                   bos.write(buff,0,bytesRead);
              }while((bytesRead=bis.read(buff,0,buff.length))!=-1)
    }catch(Exception e){
         ////error handling
         }

  • How to call webservice application using Browser

    Hi Everybody,
    Synchronous Scenario:  Calling XI Server using WebServices( Sending the Customer no through Soap and from there the receiver adapter RFC is picking that no and it will send it to R/3 using BAPI and getting the Customer Details from R/3.
    I followed the below two blogs and I created the complete scenario. And I deployed the ear file in WebAs in xi server.
    Now the question is how to run this program using the browser. That is how to call.
    Message Interface Name: CDWS_MI
    Service Name                : Soap_Service
    Namespace                   : urn:xiwebservicesusingwebdynpro.com
    Can you tell me how to call through the browser?
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3592---- [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    >1
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3593---- [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    >2
    Advance thanks,
    Abdullah Shaik.

    Hi,
    It's not clear to me what you did. Have you exposed an XI Message Interface through a Web Service? Or have you developed a Web Service in the other way? What is the "ear" that you said? Is an webdynpro app? If it is, I think your question would be properly answered at WebDynpro forum
    cheers!
    roberti

  • Creating and calling stored procedure using jdbc

    When I try to create and call a stored procedure using JDBC a very confusing error message about non-existence of the procedure just created is thrown. Using Informix database (IDS 10). Any pointers to point out what am doing wrong would be great!
    Thanks
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Scanner;
    public class CreateStoredProc {
    public static void main(String args[]){
    if (0 == args.length)
    return;
    try {
    Class.forName("com.informix.jdbc.IfxDriver");
    Connection conn = DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");
    String q = " create procedure runproc() "+
    " define i int; "+
    " let i = 0; "+
    " end procedure; "+
    " execute procedure runproc(); ";
    Statement stmt = conn.createStatement ();
    stmt.execute (q);
    } catch (Exception e) {
    e.printStackTrace();
    The stack trace:
    java.sql.SQLException: Routine (runproc) can not be resolved.
    at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3204)
    at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
    at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
    at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
    at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2157)
    at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2132)
    at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:378)
    at com.informix.jdbc.IfxStatement.a(IfxStatement.java:1299)
    at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1269)
    at com.informix.jdbc.IfxStatement.c(IfxStatement.java:989)
    at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:875)
    at CreateStoredProc.main(CreateStoredProc.java:37)
    Caused by: java.sql.SQLException
    at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
    at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
    ... 10 more

    DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");check with ur sys admin wheather the particular user in the database has >execute privilage(rights) also.i mean execute the SP in the DB level.I guess that a root user will have the enough right.
    String q = " create procedure runproc() "+
    " define i int; "+<" let i = 0; "+
    " end procedure; "+
    " execute procedure runproc(); ";
    Statement stmt = conn.createStatement ();
    stmt.execute (q);Try to use the following code:
    String q = " create procedure runproc() "+
    " define i int; "+
    " let i = 0; "+
    " end procedure; "
    Statement stmt = conn.createStatement ();
    stmt.execute (q);
    q=" execute procedure runproc(); ";
    stmt.execute (q);
    Because maybe the driver failed to precompile your sql once, so that nothing happen.

Maybe you are looking for