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
How do I add a pdf or jpeg of my company logo to my signature on emails I send from my iPad2?Read this. http://howto.cnet.com/8301-11310_39-20017611-285/add-a-sexy-html-signature-to-ip hone-e-mails/Read other 2 answers [More]
Hi, We are still using our LaserJet 5000n as the workhorse of our practice for producing half-size architectural drawings.  We have gone to Windows 7 64 bit and are not able to find a driver that will allow us to print at 1200 dpi.  We have used the [More]
Hi, I am making a PDF where chapters are marked with images. People can see the image somewhere else and can then look up the text that goes with the image in the PDF. But there are a lot of chapters, so bookmarks are required. Unfortunately I can on [More]
I have a network running some 20 switches, two controllers and many AP's.  All the devices that should be able to connect to cisco network assistant can successfully.  However there is one switch that will show in neighbours but will give the message [More]
Hi, Ijust tried posting in the Windows section but the site is down so i'll post here if that's ok? I have a full version of Windows XP installed on my 24" imac and it runs fine. I now hve a Windows Vista upgrade disc and was wondering if i can use t [More]
In the past couple of days I lost all my online audio on FF. Is there a switch or something I may have disabled that can cause this or was it the latest upgrade???? As I said it just happened in the last few days........all mixer volumes are at the h [More]
i have a login UI , when i clich on change password it opens a JDialog , i am passing 2 parameters with the call, the username and the login frame object , In the constructor of Jdialog class i am again taking 2 parameters , the username and the fram [More]
My Itunes was regularly freezing when I added any type of file to my library. To fix this problem, I followed the steps to enter Safe Mode. While it did work, the steps afterwards to lead me to my Plugins and 3rd party software were futile, as openin [More]
Ok... i'm creating a site for my work using iWeb.. i want to put the logo for our company up in the top right corner.. but the logo is actually a QT movie, which scrolls between our 2 names.. when I just drop the video on the background, you see the [More]
Recently I lost the ability to see the "places" tab while viewing photos The location services is on during taking photos. Also few weeks back I was able to see the "places" tab Thanks AkgTHANK YOU SO MUCH! Both of you (the-edmeister & [More]