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, I have a number of programs that run using an include containing the function GUI_DOWNLOAD to create files lacally or on the server.  The programs work perfectly in foreground but their purpose is to run as jobs every night and create the files o [More]
Almost all folders and files including home folder have suddenly had their sharing and permissions privileges switched to read only No indication of why this happened. Tedious to go through each item, enter password, add parties and change to read an [More]
Got a weird error message "[web window name] attempted to load Java content, but Java is unavailable or not installed". This came when -immediately after having done a shutdown and restart- Safari tried to open a web page that had never caused a [More]
I've tried installing ios 7 a few times now - it downloaded fine but when trying to install it is coming up with Error 3004. The suggested fixes for Error 3004 don't seem to be working. I made sure that my iTunes was up to date before downloading the [More]
Just need some help deciphering the etrecheck report - what does it mean/ how do i fix the errors on my disk? thanks! EtreCheck version: 2.1.8 (121) Report generated February 6, 2015 at 6:00:21 PM EST Download EtreCheck from http://etresoft.com/etrec [More]
hi gurus ... v want to know the use of MRMN0001 exit in MIRO  ...Hi, Not sure what function you want to acheive, but basicly you can use any code in the user-exit macro's customizing code, but at last you must fill in the spcified return value to mak [More]
I have just set up the file sharing option in my newly arrived iMac. I am now able to access my iMac via an old iBook G4. But for some reason, I do not have networking access in reverse: that is, I cannot access my iBook via the iMac. The iMac runs t [More]
I have students that are using voice-overs in their projects and every time they move a piece of video all of the audio shifts with the clip. These two pieces - audio and video - were each imported seperately and aligned on the tracks. Is there any w [More]
Hi experts, is it possible to call a standard SAP transaction in a custom BAPI ?? How do we suppress the standard SAP screens if we can call the transaction?? BAPI for creation of material document number by using static inputs like moment type 311, [More]
A window pops up that says a new version of Firefox is available (version 32.x). I click on install, and nothing happens. The wheel keeps spinning so I close the window. When I click on About Firefox and then click on Updates available at https://www [More]