I am new to Spring 3.0 . For DAO access i have choosen SpringJDBC. SpringJDBC provides JDBC Template and SimpleJDBCTemplate . Which one is best. I read in some of the forum SimpleJDBCTemplate going to be deprecated in Spring 3.1. What is the difference between these two.Guide me which one is best.
JdbcTemplate and SimpleJdbcTemplate
Asked Answered
In Spring 3.x you should use JdbcTemplate
.
In previous versions of Spring SimpleJdbcTemplate
leveraged new features of Java 5, whereas JdbcTemplate
maintained compatibility with pre-Java 5 environments. But now all features of SimpleJdbcTemplate
have been added to JdbcTemplate
.
Thanks a lot.The query we are using is whether DB specific in SpringJDBC or SpringJDBC provides any option that our query will run in any kind of DB like Hibernate provides HQL.(Now i am using SQL DB in future i might go with oracle , So the same will run in oracle or needs any change in future) –
Evieevil
No, spring HSBC doesn't provide any abstraction over SQL. –
Frock
In spring 4.1.3, SimpleJdbcTemplate is deprecated and it has been completely removed in 4.3.3
Deprecated in Spring 3.1 - docs.spring.io/spring-framework/docs/3.1.x/javadoc-api/org/… source: https://mcmap.net/q/666343/-java-spring-jdbctemplate –
Acerate
© 2022 - 2024 — McMap. All rights reserved.
SimpleJdbcTemplate
supports named parameters like inNamedParameterJdbcTemplate
, butJdbcTemplate
only supports?
style parameters. – Rihana