我在使用Spring JdbcTemplate在apache phoenix中插入值时遇到问题。 查询工作正常,所以我正确与凤凰连接。 此外,当我通过直接JDBC进行更新时,它可以工作。
只有当我使用更新方法时,它才会在数据库中产生任何影响。 没有错误或警告。我的代码:
String sql = "upsert into fanpages(ID,NAME,CATEGORY) VALUES (7, 'new', 'new')";
jdbcTemplateObject.update(sql);
控制台:
DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing SQL update [upsert into fanpages(ID,NAME,CATEGORY) VALUES (7, 'new', 'new')]
DEBUG: org.springframework.jdbc.core.JdbcTemplate - SQL update affected 1 rows
我错过了什么吗?为什么它不起作用?
答案 0 :(得分:1)
您是否尝试过调用composer dump-autoload
?我使用commit
(一个python模块)来插入凤凰表。只有当我调用jaydebeapi
时,才能将值真正地插入到表中。