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

  • Home
  • SEARCH
  • 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 6709621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:54:12+00:00 2026-05-26T07:54:12+00:00

I develop java application using Spring 3.0.5 and I work with database Oracle using

  • 0

I develop java application using Spring 3.0.5 and I work with database Oracle using mybatis-spring.

I’ve an interface for mybatis:

public interface SubscriberMapper {
    Subscriber getSubscriberByMsisdn(String msisdn);

    void insertSubscriber(Subscriber subscriber);

    void updateSubscriber(Subscriber subscriber);

    void canCustomerSubscribe(@Param("msisdn") String msisdn, 
                         @Param("responseCode") Integer responseCode);

}

mybatis xml content for canCustomerSubscribe:

<parameterMap id="canCustomerSubscribeParams" type="map">
    <parameter property="msisdn" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
    <parameter property="responseCode" jdbcType="NUMERIC" javaType="java.lang.Integer" mode="OUT"/>
</parameterMap>
<select id="canCustomerSubscribe" parameterMap="canCustomerSubscribeParams" statementType="CALLABLE">
    CALL wallet.pkg_wallet_validation.can_customer_subscribe(#{msisdn}, #{responseCode})
</select>

and code to execute:

public void subscribe(String msisdn) throws InvalidArgumentException {
    Integer responseCode = 0;
    subscriberMapper.canCustomerSubscribe(msisdn, responseCode);
    System.out.println("msisdn: " + msisdn + ", responseCode: " + responseCode);
}

When I execute “subscribe” method with invalid “msisdn”, I do not receive real out value from procedure. Execution of this procedure in the database returns reponseValue = 1001, but in Java code I receive 0. I turned on debug logging to stout for mybatis and output is:

2011-10-19 10:32:46,732 DEBUG [main] (Slf4jImpl.java:28) ooo Connection Opened
2011-10-19 10:32:46,909 DEBUG [main] (Slf4jImpl.java:28) ==>  Executing: CALL wallet.pkg_wallet_validation.can_customer_subscribe(?, ?) 
2011-10-19 10:32:46,911 DEBUG [main] (Slf4jImpl.java:28) ==> Parameters: 509999999(String), 0(Integer)
msisdn: 509999999, responseCode: 0

When I change in “subscribe” method responseCode = null, I receive and error:

org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter.  Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: Invalid column type
; uncategorized SQLException for SQL []; SQL state [null]; error code [17004]; Invalid column type; nested exception is java.sql.SQLException: Invalid column type
  • 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-05-26T07:54:13+00:00Added an answer on May 26, 2026 at 7:54 am

    I found solution. Map must be user instead of two parameter in canCustomerSubscribe method.

     void canCustomerSubscribe(Map<String,Object> params);
    

    mybatis xml content:

    <select id="canCustomerSubscribe" parameterType="java.util.HashMap" statementType="CALLABLE">
        CALL wallet.pkg_wallet_validation.can_customer_subscribe(
        #{msisdn, jdbcType=VARCHAR, javaType=java.lang.String, mode=IN},
        #{responseCode,jdbcType=NUMERIC, javaType=java.lang.Integer, mode=OUT})
    </select>
    

    (I need to add the commas between arguments attributes)

    calling it from subscribe service method:

    public void subscribe(String msisdn) throws InvalidArgumentException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("msisdn", msisdn);
        params.put("responseCode", null);
        subscriberMapper.canCustomerSubscribe(params);
        System.out.println(params.get("responseCode"));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Eclipse to develop a Blackberry Java application.Is possible to automatically increment
I have been trying to develop a Java ME application using WTK 2.5.2 (Java
I'm using Netbeans to develop a Java application and I want to create a
I am trying to develop one simple application using Java, Flex and Blazeds. I
i'm trying to develop a client-server chat application using java servlets and mysql(innoDB engine)
I have a simple Java web application using HSQLDB embedded database. The application is
How to develop a IPad Application using Java in Windows, am a Java developer
If I develop my web application on GAE using Java, in future would I
For my work I have to develop a small Java application that parses very
I would like to develop a web application in Java/Spring/Hibernate serving as a business

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.