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
I want to transfer some purchases that are on my iPad to my iPod touch but the iPad and iPod have different accounts. Can I still transfer the purchase?Jjaeger, Keynote presentations created on Mac can be transferred to iPad easily in many ways: - Co [More]
Hi! Since the last upgrade (to xf86-video-ati 6.7.195-2) I observe a color corruption on my Thinkpad X31 (Radeon Mobility M6 LY, 16MB) exactly as described here: https://bugs.launchpad.net/xorg-server/+bug/150361 Curiously, when I run xrandr --output [More]
I'm just curious what they think anonymous actually means.  When I look it up it says: a·non·y·mous [uh-non-uh-muhs] adjective 1. without any name acknowledged, as that of author, contributor, or the like: an anonymous letter to the editor; an anonym [More]
I am having so much trouble with this... I'm working with a t400, and using the hdd in the ultrabay not wanting to touch the main hdd. The idea is to Install slackware to the Ultrabay drive, which should be simple... However I can't boot from DVD, so [More]
I can not start the device after I shut it down by pressing & holding the start button. I took this measure because I was not able to force quit/shut down while on internet. The program was not responding and laptop got hot.. Any body help please.... [More]
Problem: Most of my DVDs have the Hong Kong region code (whatever it is) and my macbook will not play those dvds only the north american region coded ones. Is there some kind of codec to let me play these other DVDs which make up 95% of my DVD collec [More]
If I create a component in the Desgin view, the switch to Java Editor and uze Cancel (or Ctrl+Z), it cancle the op�ration, ie remove the code added when the component was created. The component is also removed in Design view. However, it is stil pres [More]
While there are many GUI-based backup and storage tools for Linux users, there are also a few command line-based tools. "Rsync" is one of these tools and, according to Linux.com, it stands for remote sync. With afull tutorial on how to use rsync [More]
Hi, the business object explorer allows to upload excel sheets. i search a convention for an excel sheet because sometimes the excelsheet would not be accept from the business object explorer. regards, thomasHi, the business object explorer allows to [More]
Hi,   I have created an outbound ASN IDOC for intercompany transfer. But this ASN is not creating the Inbound delivery IDOC. I have configured the partner profile for both outbound and Inbound. Please let me know what I am missing. Thanks RamHi Ram, [More]