Top "Jdbctemplate" questions

The JdbcTemplate class is a key part of the Spring Framework JDBC abstraction.

How can I get the autoincremented id when I insert a record in a table via jdbctemplate

private void insertIntoMyTable (Myclass m) { String query = "INSERT INTO MYTABLE (NAME) VALUES (?)"; jdbcTemplate.update(query, m.getName()); } When the above …

java mysql spring-mvc jdbctemplate
What does JdbcTemplate do when RowMapper returns null?

I am using the JdbcTemplate.query(sql, args, rowMapper) method call to return a list of objects. There are some …

java spring jdbctemplate
Java Spring - RowMapper ResultSet - Integer/null values

I have a Java SE 8 Spring 4.1.6-RELEASE application, where I am implementing the org.springframework.jdbc.core.RowMapper<T&…

java spring jdbc jdbctemplate
How to get generated ID after I inserted into a new data record in database using Spring JDBCTemplate?

I got a very common question when I was using Spring JDBCTemplate, I want to get the ID value after …

database spring unique jdbctemplate persistent
Spring JdbcTemplate batchUpdate handling exceptions

Currently our code uses batchUpdate method of JdbcTemplate to do batch Insertion. My question is in case of any exception …

spring jdbc jdbctemplate spring-jdbc batch-updates
Spring JDBCTemplate Stored Procedure with ResultSet and OutPut Parameter

I created a stored procedure which returns result rows and two output parameters. I am unable to find any thing …

spring resultset jdbctemplate java-stored-procedures output-parameter
How to use PostgreSQL hstore/json with JdbcTemplate

Is there a way to use PostgreSQL json/hstore with JdbcTemplate? esp query support. for eg: hstore: INSERT INTO hstore_…

java spring postgresql jdbctemplate hstore
JdbcTemplate queryForList return value in case of no results

The question is pretty much summed up in the title. What will JdbcTemplate.queryForList() return when the query returns no …

java spring jdbctemplate
Method may fail to clean up stream or resource on checked exception -- FindBugs

I am using Spring JDBCTemplate to access data in database and its working fine. But FindBugs is pointing me a …

java spring jdbctemplate findbugs
Spring (MVC) SQL injection avoidance?

I am wondering how Spring MVC handles SQL injections (and other security issues: XSS, code [javascript] injection, etc). I'm talking …

spring sql-injection jdbctemplate