Skip to content
Advertisement

Tag: spring-jdbc

jdbctemplate count queryForInt and pass multiple parameters

How can I pass multiple parameters in jdbcTemplate queryForInt to get the count. I have tried this, But its showing queryForInt as strikes. Answer Both queryForInt() and queryForLong() are deprecated since version 3.2.2 (correct me if mistake). To fix it, replace the code with queryForObject(String, Class). As per spring docs int queryForInt(String sql, Map args) Deprecated. Query for an int

How to query for a List in JdbcTemplate?

I’m using Spring’s JdbcTemplate and running a query like this: There are no named parameters being passed, however, column name, COLNAME, will be passed by the user. Questions Is there a way to have placeholders, like ? for column names? For example SELECT ? FROM TABLEA GROUP BY ? If I want to simply run the above query and get

Stored Procedure returning multiple tables to spring jdbc template

Iam calling a stored procedure from my Spring DAO class using JdbcTemplate. My problem is that, stored procedure returns multiple tables. Is there a way to access multiple tables using Spring JdbcTemplate. If I use jdbcTemplate.queryForList(myStoredProc, new Object[]{parameters} iam getting only first table from the result. My database is SQL Server 2005. Is there any method other than jdbcTemplate for

Advertisement