Hi I am using Spring Boot 1.3.5.RELEASE. I have a situation where I need to fire
INSERT INTO someTable1 (col1, col2, col3)
SELECT (10346, someTable2Id, 1048) FROM someTable2.
I am using Spring JdbcTemplate.
String sql = "INSERT INTO someTable1( col1, col2, col3 )
SELECT 10346, someTable2Id, 1048
FROM someTable2";
jdbcTemplate.update(sql);
While executing this statement, it got stuck on jdbcTemplate.update(sql) line.
It seems JdbcTemplate
is not responding well to INSERT INTO...SELECT
Statement.
Same query is working fine from Database Editors.
someTable2
can have too much records ? Can you try the same for only 1 record fromsomeTable2
by adding aWHERE
statement. Can you provide the type ofjdbcTemplate
are you usingNamedParameterJdbcTemplate
? And lastly are other calls from the BE to the DB working ? – LigettiJdbcTemplate
andNamedParameterJdbcTemplate
. It is giving me no error. But when I calljdbcTemplate.update(sql)
, execution hangs there. Then I tried with normalJDBC
program, still no error but execution hangs there.someTable2
has nearly 700 records. – AmylINSERT INTO...SELECT
from my application. – Amyljdbctemplate.execute()
– Allover