Sitemap

Amicuk Programming Answers

Unable to retrieve the values from stored procedure

2015-10-11   Views:1

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
Hi All.. I am working on a smartform. While activating the form, i came across a error called "A line of I_ITEMS and WA_ITEMS is not mutually convertible. In Unicode program, I_ITEMS must have  same structure layout". But in program, i have defi [More]
Simple task but I am not able to fix this. I have a dummy resource whcih I created for some testing.However I am not able to see this resource when I try to provision a user to this resource. Any Ideas? FYI:.I have checked Allow SelfService,Allow All [More]
Give XML DTD : <!ELEMENT a (b, c)> <!ELEMENT b (#PCDATA)> <!ELEMENT c (d, e)> <!ELEMENT d (#PCDATA)> <!ELEMENT e (#PCDATA)> I made schema at Oracle8i as this: create type c_t as object (d varchar2(3), e varchar2(3)); create t [More]
I have the following problem: My RMI-Server runs for ever. In a batch-queue I have a procedure which looks periodly wether rmiregistry and RMI-Server exists. On error both processes are killed and restarted. My client as a simple example is displayin [More]
When I using JCOP-debug mode in eclipse, I want to view the variable in the Variable window. I can see the "this" instance in the window. But when I click the "+" beside "this" to view the member variables of the instance. De [More]
I'm not a PHP wiz - in fact I am not a backend coder so I am somewhat struggeling with the sample scripts - I still hope for a CF sample... I'm trying to run and log in to AFCS via the commandline (Terminal). I'm not sure what I'm doing wrong - here [More]
I have an old G4 powerbook with a dead battery but it doesn't have an ac adapter. I bought a cheap replacement one on Amazon. When I plugged it into the G4 nothing happens. It doesn't charge the battery and I can't power on the powerbook. I wanted to [More]
I'm having trouble downloading adobe flash player onto my Asus nexus tablet for some reason its saying that it isn't available but that's bull crap cuz I had it downloaded for YouTube....so needless to say I'm confused! Please any and all help or adv [More]
Hi all, I have recently started getting countless "Your IMAP server closed the connection" error messages in Outlook 2010.  Increasing the timeout in settings didn't help.  Sometimes my email quits refreshing at all until I close Outlook and re- [More]
I pasted a log in the Actions & Solutions and saved it. Now i want to edit the content of HISTORY as it contains wrong information. Is is possible to change the data in history?You can edit the ACTIONS_DESC and ACTIONS_DESC_HTML values in the CL_PROB [More]