Sitemap

Amicuk Programming Answers

Unable to retrieve the values from stored procedure

2015-10-11   Views:0

Advertisement

Hi all I written one procedure and when i am trying to invoke that store procedure from jdbc it is throwing the following error . java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStat ement         at com.srit.hrnet.helpdes

Hi all
I written one procedure and when i am trying to invoke that store procedure from jdbc it is throwing the following error .
java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStat
ement
        at com.srit.hrnet.helpdesk.grievancemechanism.GrievanceComplaintDAO.getE
mployerGenDetails(GrievanceComplaintDAO.java:895)
        at com.srit.hrnet.helpdesk.grievancemechanism.GrievanceComplaintAction.d
eleteComplaints(GrievanceComplaintAction.java:1095)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchActio
n.java:276)
        at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:
196)
        at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116
4)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        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 com.srit.hrnet.filter.SessionValidateFilter.doFilter(SessionValidateF
ilter.java:79)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
        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
:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:744)
        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)
java.lang.NullPointerException
        at com.srit.hrnet.helpdesk.grievancemechanism.GrievanceComplaintAction.d
eleteComplaints(GrievanceComplaintAction.java:1098)and my code is
store procedure is
============
create or replace procedure SP_HD_GRIEVANCE_DELETE_DETAILS(in_queryid IN number DEFAULT NULL,RC1      IN OUT globalPkg.RCT1)
as
queryId number(18,0);
BEGIN
SP_HD_GRIEVANCE_DELETE_DETAILS.queryId := SP_HD_GRIEVANCE_DELETE_DETAILS.in_queryid;
  IF  SP_HD_GRIEVANCE_DELETE_DETAILS.queryId  = 1 THEN
         BEGIN
         OPEN RC1 FOR
        select HGRMCODE as compcode,emcode as applyEmpId,EMFNAME as assName,designame as desig,deptname as department ,to_char(HGRMOCCRDT,'DD/MM/YYYY') as occdate,
                    HGRMSLATYPE as category,HGRMSUBCAT as subcat,HGRMSLAPRIORITY as priority,HGRMSTATUS  as status from EMP_MSTR,HD_GRIEVANCE_RM_MSTR,
                    dept_mstr,desig_mstr where EMCODE=HGRMAPPLYEMCODE and EMDEPTCODE=deptcode and desigcode=EMDESIGCODE order by HGRMCODE;
        END;
     END IF;
END SP_HD_GRIEVANCE_DELETE_DETAILS;and javacode is
==========
con = new DBConnection().getConnection();
java.sql.CallableStatement stmt = con.prepareCall("{call SP_HD_GRIEVANCE_DELETE_DETAILS(?,?)}");
                    stmt.clearParameters();
                    stmt.setInt(1,1);
                    stmt.registerOutParameter(2, OracleTypes.CURSOR);
                    stmt.execute();
                    cursor = ((OracleCallableStatement)stmt).getCursor(1);
list  = new ArrayList();
                    while (cursor.next()) {
compTO = new GrievanceComplaintTO();
list.add(compTO);
}where GrievanceComplaintTO is formbean class
Please Guide me.
Thanks in advance.

The replay answer
Advertisement
Obviously, this
cursor = ((OracleCallableStatement)stmt).getCursor(1);fails because you don't get an OracleCallableStatement.

Go to See the other 3 answers

Unable to retrieve the values from stored procedure

Category:DefaultRelease time:2015-10-11Views:130

Hi all I written one procedure and when i am trying to invoke that store procedure from jdbc it is throwing the following error . java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStat ement         at com.srit.hrnet.helpdes[More]

Retrieving cursor from a stored procedure

Category:DefaultRelease time:2015-10-11Views:130

Hi, Is there any means to retrieve a cursor from a stored procedure using java.sql.* package, without using database specific type code like OracleTypes.CURSOR? Regards, Shalin.Hi, I had some across this problem some time ago. Although, there is no d[More]

Unable to run SSIS Package using Stored Procedure

Category:DefaultRelease time:2015-10-11Views:130

Hi Guys,         I have create one simple SSIS Package(Move the first table record to second table).It will execute fine in locally. But, If i'm going call/execute .dtsx file using stored procedure. I'm getting Error. so please let me know the valuab[More]

Retrieve data from a stored procedure using powerpivot

Category:DefaultRelease time:2015-10-11Views:130

Hi there. I'm new to SQL and would like to import the below stored procedure to PowerPivot. PowerPivot says the statement is valid, but fails to import the stored procedure and returns this error "OLE DB or ODBC error: Changed database context to 'Si[More]

OIM: Retrieve data from stored procedure,  pre populate it in Resource form

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I need to retrieve data form a stored procedure that i have created . This data needs to be per populated in the Iplanet resource from. The stored procedure will have one input string and one output string. Thankz, Sanjay Rulez1. Prepare OIM Admi[More]

Read data from a Stored Procedure in Android

Category:DefaultRelease time:2015-10-11Views:130

I have a Stored Procedure say CustOrdersDetail. I have created a MBO for it in the workspace and deployed it on SAP Mobile Server. I am unable to read data from the stored procedure in code of the Android Application. If I pass a default load argumen[More]

Calling a stored procedure of oracle 8 from java

Category:DefaultRelease time:2015-10-11Views:130

hello, i made a stored procedure as below in 1 program :      String url = "jdbc:odbc:rjc1";      Connection con = DriverManager.getConnection(url,"scott","tiger");      Statement stmt = con.createStatement();      String cre[More]

Calling a stored procedure or ioracle 8 from java

Category:DefaultRelease time:2015-10-11Views:130

hello, i made a stored procedure as below in 1 program :      String url = "jdbc:odbc:rjc1";      Connection con = DriverManager.getConnection(url,"scott","tiger");      Statement stmt = con.createStatement();      String cre[More]

Problem creating dataset using db2 stored procedure in Eclipse BIRT

Category:DefaultRelease time:2015-10-11Views:130

Hi, I am using DB2 9.7 Express Edition in Eclipse BIRT(version 2.5.1) for generating reports. I have used Type4 driver for jdbc connection. For that, I have established jdbc connection using db2jcc.jar and db2jcc_license_cu.jar files. I have successf[More]

Privilege for creating a View from a Stored Procedure

Category:DefaultRelease time:-0001-11-30Views:130

Hi,                      I need to create a view from a procedure. I could do it from an anonymous block whereas I am unable to do that from a Stored Procedure. Should I need a specific privilege for performing this operation? If so what would be the[More]

PowerPivot tables and stored procedures

Category:DefaultRelease time:-0001-11-30Views:130

What can I use to dynamically create a PowerPivot table in excel, using a stored procedure as a data source? Onyx12Hi there Thank you for your response. Here's what I'm trying to achieve and I stand under correction. I have a stored procedure which I[More]

Hot
hey guys, I am trying to install data services 4.0 on a windows server with MS SQL database as the repository database. So, my plan was to install MS SQL 2008 first, then IPS, then data services. But i am facing a problem in installation of MS SQL it [More]
I am trying to configure my SCXI-1540 w/1315 card for excitation voltage and frequency using MAX - but it is not giving me that option when I click on the card and then properties, am I looking in the wrong place? I have LabVIEW Express 7.0 Professio [More]
EA1 seems to have taken a backward step when it comes to supporting bind variables in PL/SQL. Back in 1.1.3, according to the bugs fixed list, we apparently fixed bug 5884935 (BINDS IN A PL/SQL STATEMENT HAS "NOT ALL VARIABLES BOUND" ERROR), alt [More]
Hi I am stuck with this issue for a long time now. i have searched the net and not found any satisfactory solution for my issue. i will describe it below. In my application i am generating the WSDL from the server-config.wsdd file. For the WSDL to be [More]
ODI 11.1.1.6.2 We are staging a number of tables using DB links and I have created an Oracle to Oracle LKM that has a single step to capture the source table name and DB Link so that it can be referenced by the IKM;    <% v_src_table=odiRef.getSrcTab [More]
Dear All, I need to be able to find all the screen and field definitions that exist in the SAP Repository for an application I am developing.  Can anybody tell me where to find them?  I specifically need to know which field types are defined for each [More]
Hi, I was just wondering if there was any way to reset Finder, so all previous preferences are removed, and it reverts to how it was when the system was first installed? I want to do this because quite a few strange this happen, such as when I copy a [More]
Hi all I try to send Email with Publisher, No with Job Manager scheduler I can send Email with Oracle Data Integrator with the same configuration with publisher, but publisher say me errors, I don´t think if I have wrong configuration or i will have [More]
My videos purchased from other than Itunes are not showing up in ICloud on my IPad.  I have Match.  Please helpiTunes Match is for music only as is stated on the website, http://www.apple.com/itunes/itunes-match/Read other 2 answers [More]
I think I am going to take the leap into mac. I really like the mac pro, but I am not ready to trade in my lap top. Am I going to have any problems switching back and forth from the Mac Pro to my Sony Vaio lap top?You can run Windows on your Mac Pro. [More]