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 8489169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:45:10+00:00 2026-06-10T21:45:10+00:00

I am trying to execute an SQL Function using Spring JDBC. My code is

  • 0

I am trying to execute an SQL Function using Spring JDBC.

My code is

SimpleJdbcCall caller = new SimpleJdbcCall(this.jdbcTemplateRandOnline).withCatalogName("RATELIMIT_OWN").withFunctionName("Get_Logs");
RateLimitLogBean resultBean = null;
SqlParameterSource paramMap = new MapSqlParameterSource().addValue(P_YYYYMM, inputBean.getMonth(), Types.VARCHAR).addValue(P_NUMEC, inputBean.getNumec(), Types.INTEGER);
resultBean = caller.executeFunction(RateLimitLogBean.class, paramMap);

but when I run this code, I am getting below error

org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{? = call RATELIMIT_OWN.GET_LOGS()}];
SQL state [99999]; error code [17041]; Missing IN or OUT parameter at index:: 1;
nested exception is java.sql.SQLException: Missing IN or OUT parameter at index:: 1 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030) at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064) at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388) at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351) at org.springframework.jdbc.core.simple.SimpleJdbcCall.executeFunction(SimpleJdbcCall.java:154)

I couldn’t understand why it’s throwing this error. For prepared statements we declare input and output params and compile them. But for functions, how can we compile when we are passing it as SqlParamSource

Sql Function

FUNCTION RATELIMIT_OWN.Get_Logs ( p_yyyymm VARCHAR2, p_numec NUMBER )

This function returns records of type

TYPE RATELIMIT_OWN.LOG_RECORD AS OBJECT
   (EVENTID              VARCHAR2(15),
    MSG                    VARCHAR2(2000),
    CREATE_DATE      DATE);

I have debugged to Spring framework. What I found is, in

org.springframework.jdbc.core.metadata.CallMetaDataContext.reconcileParameters method, I am getting this.metaDataProvider.getCallParameterMetaData() this arraylist with all values are null.

Any reason?

  • 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-10T21:45:11+00:00Added an answer on June 10, 2026 at 9:45 pm

    You have to declare the params of the function, something like that:

    SimpleJdbcCall caller = new SimpleJdbcCall(this.jdbcTemplateRandOnline)
                                               .withCatalogName("RATELIMIT_OWN")
                                               .withFunctionName("Get_Logs")
                                               .withReturnValue()
                                               .declareParameters(
                                                  new SqlParameter("p_yyyymm",java.sql.Types.VARCHAR))
                                               .declareParameters(
                                                  new SqlParameter("p_numec",java.sql.Types.INTEGER));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to execute Oracle function using Spring jdbc. But I am getting
I am trying to execute dynamic SQL in a Servlet using JDBC, I need
Hi I am trying to execute stored procedures using Spring JDBC. Here's the SP
I'm trying to execute an SQL Job using a CRM Workflow by making a
this is my first question. I'm trying to execute a SQL query in django
I am trying to read a SQL Server table in C++ using a function
I'm trying to execute a SQL query from within a PHP function but I
Im trying to execute a scalar valued function in an insert query. Im using
I am trying to load a file using the SQL Server Import Data function
trying to execute the stored proc in EF using the following code: var params

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.