Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7706571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:09:29+00:00 2026-06-01T00:09:29+00:00

In our Struts2-Spring application we are using the follwoing lines of code access the

  • 0

In our Struts2-Spring application we are using the follwoing lines of code access the procedure

ServerSession serverSession = null;
ClientSession cSession = null;

            serverSession = (ServerSession) SessionManager.getManager().getSession("db_session"); 
            cSession =serverSession .acquireClientSession();

            StoredProcedureCall call = new StoredProcedureCall();
            call.setProcedureName("usp_list_dept_users");
            call.addNamedArgumentValue("p_user_id", user_id);
            call.useNamedCursorOutputAsResultSet("RCT1");
            List<DatabaseRecord> list = cSession.executeSelectingCall(call);
            ListIterator<DatabaseRecord> litr = list.listIterator();
--------------
-------------
-------------

This code is working for oracle db. But the same code not working when connecting SQLserver db

List<DatabaseRecord> list = cSession.executeSelectingCall(call);

throws nullpointerexception

following is the Session.xml contents used to connect SQLserver

<session xsi:type="server-session">
      <name>db_session</name>
      <event-listener-classes/>
      <logging xsi:type="toplink-log"/>

      <login xsi:type="database-login">
         <platform-class>org.eclipse.persistence.platform.database.SQLServerPlatform</platform-class>
         <user-name>sa</user-name>
         <password>testpwd</password>
         <sequencing>
            <default-sequence xsi:type="native-sequence">
               <name>Native</name>
            </default-sequence>
         </sequencing>
         <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
         <connection-url>jdbc:sqlserver://172.16.12.7:1433;databaseName=stdentlist</connection-url>
      </login>
      <connection-pools>
         <read-connection-pool>
            <name>ReadConnectionPool</name>
         </read-connection-pool>
         <write-connection-pool>
            <name>default</name>
         </write-connection-pool>
      </connection-pools>
      <connection-policy/>
   </session>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:09:30+00:00Added an answer on June 1, 2026 at 12:09 am

    The stack trace would help, but, stored procedure are very database specific.

    call.useNamedCursorOutputAsResultSet(“RCT1”);

    This does not make sense on SQL Server as it does not have cursor output parameters, I assume your stored procedure definition is very different on SQL Server, so you will need a different call. SQL Server can return result sets from stored procedures, so probably just remove the cursored out.

    Also ensure that the stored procedure exists in the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we are using Struts2 in our code and I have scenario where I need
We are currently using the struts2-jquery plugin in our web-application. The plugin works great
I am currently upgrading our application from Webwork to Struts2. Today I run into
I'm working on on a site built using struts2. The vast majority of our
We are load testing our web application(Java, Struts, Spring, Java EE). The results show
We are using struts 1.2.4 in our application. The application currently allows caching of
Our application is interfacing with a lot of web services these days. We have
There are few open source projects/APIs/libraries that we use in our project ( Spring,
we are working on a web application which is developed using Struts 2 Framework.
We have an application deployed on Tomcat 6. It's built on Spring/Struts 2, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.