0

I am coming from .NET to Java Spring Boot.

In .NET, I prefer to use ADO and stored procedures for my data access layers.

The closest Java equivalent I have found so far seems to be SimpleJdbcCall.

In .NET I can declare my params AND values going to the stored procedure all in one easy line:

cmd.Parameters.Add(new SqlParameter("@ParamName", ParamValue));

However, I am hard pressed to find an equivalent of this in Java Spring Boot.

I am forced to maintain 2 separate "lists" of params, and then their values, like this:

.declareParameters
(
    new SqlParameter("@ParamName", Types.INTEGER)
)

MapSqlParameterSource inParams = new MapSqlParameterSource();

inParams.addValue("@ParamName", 1);

Does anyone have a way to simplify this into one line like in .NET?

Taylor Brown
  • 1,689
  • 2
  • 17
  • 33
  • 1
    Have you looked at [JDBI](https://jdbi.org) or [JOOQ](https://jooq.org)? – rzwitserloot Mar 05 '23 at 22:37
  • @rzwitserloot No I have not yet... Still getting my feet wet and more exploration is still needed... I will look into those, thanks for recommending some alternatives. – Taylor Brown Mar 05 '23 at 22:50

0 Answers0