PostgreSQL 中的 Query 错误没有返回任何结果 [英] No results returned by the Query error in PostgreSQL

查看:43
本文介绍了PostgreSQL 中的 Query 错误没有返回任何结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据插入表中.执行查询后,我收到一个异常说明

I am trying to insert a data into a table. After executing the query i am getting an exception stating

org.postgresql.util.PSQLException: No results were returned by the query.
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:284)

数据已成功插入,但我不知道为什么会出现此异常??

The data is getting inserted successfully, but i have no idea why i am getting this exception ??

推荐答案

使用

executeUpdate

代替

executeQuery

如果不返回数据(即非SELECT操作).

if no data will be returned (i.e. a non-SELECT operation).

这篇关于PostgreSQL 中的 Query 错误没有返回任何结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆