Top "Jdbctemplate" questions

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

JdbcTemplate IN Clause for String elements

Am using NamedParameterJdbcTemplate for where Clause elements and one of them seems to be List<String>. JdbcTemplate replaces …

java jdbc collections jdbctemplate
Unit testing a DAO class that uses Spring JDBC

I have several DAO objects that are used to retrieve information from a database and I really want to write …

java spring testing dao jdbctemplate
Does Spring's JdbcTemplate close the connection if an exception is thrown?

When Spring catches an SQLException, does it close the prepared statement, result set, and/or connection before throwing it's own …

java spring exception-handling jdbctemplate
getting DateTime from ResultSet in JdbcTemplate

in database my column is of type TIMESTAMP, so my class has properties of type Datetime like this: public void …

java datetime jdbc jodatime jdbctemplate
jdbctemplate count queryForInt and pass multiple parameters

How can I pass multiple parameters in jdbcTemplate queryForInt to get the count. I have tried this, Integer count = this.…

java spring-jdbc jdbctemplate
JdbcTemplate query close database connection

I use jpa with hibernate. I have following method: @Transactional public void myMethod(){ ... firstJDBCTemplateQuery(); secondJDBCTemplateQuery(); ... } firstJDBCTemplateQuery works, but it closes …

spring hibernate jpa jdbctemplate
insert row and get generated ID

I'm trying to use Spring's JdbcTemplate class to insert a row into a MySQL table named transaction and get the …

java jdbctemplate spring-jdbc
Using a prepared statement and variable bind Order By in Java with JDBC driver

I'm using jdbcTemplate to make JDBC connections to a mySQL DB prepared statements to protect myself as much as possible …

java sorting jdbc collections jdbctemplate
Can I set a JDBC timeout for a single query?

I have a web app on Tomcat, which handles DB connection pooling, and using Spring JDBCTemplate for executing queries. It's …

sql spring jdbc timeout jdbctemplate
how to copy a data from file to PostgreSQL using JDBC?

I want to copy data from file to PostgreSQL DB using JDBC. I was using JDBC statement object to copy …

java database postgresql jdbc jdbctemplate