FAQ(57):java.sql.SQLException: Can not issue data manipulation statements with executeQuery().

fibplus-8.0.0.zip FIBPlus 是一套面向 Delphi / C++Builder 的 Firebird、InterBase 数据库访问组件,特点是直接走原生客户端 API,不经 BDE/ODBC,速度快且可控性强。8.0.0 版本主要适配 Delphi 2009 及以后的版本(Delphi 6–2007 需用 7.9.x),核心组件包括 TpFIBDatabase、TpFIBTransaction、TpFIBDataSet 等,支持精细事务管理、本地缓存、BLOB 处理和备份恢复等数据库服务。该库原为 Devrace 的商业组件,现由社区在 GitHub 的 madorin/fibplus 项目开源维护,建议从官方仓库获取源码而非第三方网盘压缩包。安装时解压后用对应版本的工程组(10.4+ 统一为 `FIB.groupproj`)Build 全部包,再 Install `dclFIB` 并在 Library 路径加入 Source 目录即可。新项目中若需官方技术支持,也可考虑 FireDAC、IBDAC 等更现代的替代方案。 立即下载

1、场景:springmvc+spring 实现功能

2、Log:

java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
	com.mysql.jdbc.Statement.checkForDml(Statement.java:298)
	com.mysql.jdbc.Statement.executeQuery(Statement.java:750)
	com.User.Dao.UserDaoImpl.add(UserDaoImpl.java:199)
	com.User.Service.UserServiceImpl.add(UserServiceImpl.java:36)
	com.User.Controller.UserController.addUserSave(UserController.java:177)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	java.lang.reflect.Method.invoke(Unknown Source)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

解决:
原因是这句:st.executeQuery("insert  into  student  values('"+name+"','"+age+"','"+introduce+"')") ;

我是看了书上一个例子,然后开始模仿,发现问题后,发现书上其他程序语句都是用这句,

后来看了几个网页,才明白这句应该该成这样子:st.execute("insert  into  student  values('"+name+"','"+age+"','"+introduce+"')") ;

最后总结:如果你的SQL 语句是诸如update,insert的更新语句,应该用statement的execute()方法,如果用的是statement的executeQuery()就会出现上诉问题



grafana对接zabbix数据展示 【配置】点击【模板】点击【创建模板】添加三个监控项:【名称】搜索【】创建的模板;点击上方【监控项】,点击创建【监控项】点击上方【触发器】点击【创建触发器】主机关联监控模板:左侧【配置】点击 【主机】点击【Zabbix server】查看:左侧点击【监测】点击【主机】点击【Zabbix server】点击最新数据,找到添加的三个模板主机关联监控模板:左侧【配置】点击 【主机】点击【Zabbix server】把监控模板用起来① 明确获取指标数据的方法。 阅读详情

相关推荐

基于Python+OpenCV中文及符号检测

一、项目背景与意义在图像处理、文档识别、自动翻译等场景中,中文及符号的准确检测是一个重要且复杂的任务。传统的字符检测方法往往对英文等拉丁字母系的识别效果较好,但对中文及特殊符号的识别准确率较低。本项目旨在利用Python编程语言结合OpenCV库,开发一个能够高效、准确地检测图像中中文及符号的系统,为相关领域的研究和应用提供技术支撑。二、技术实现图像预处理:利用OpenCV的图像处理功能,对输入的图像进行灰度化、二值化、滤波去噪等预处理操作,以提高中文及符号检测的准确性[1]。

2301_79809972的博客 1119

Can not issue data manipulation statements with executeQuery().

Can not issue data manipulation statements with executeQuery().

杨鑫newlife的专栏 1336

RT-Thread stm32h7使用串口DMA

stm32h7在rtthread中无法使用串口DMA,通过更改驱动代码使其支持串口DMA

qq_35141454的博客 2285

Can not issue data manipulation statements with executeQuery().解决方案

这两天作者在进行数据库交互的时候,遇到了这个error,显示错误的是这一句代码 statement.executeQuery(sql); 作者百思不得其解,祭出大杀器,内事不决问百度,看了两篇博客,两个大佬提出了不同的解决方案,但大致相同 executeQurery()改成excuteUpdate() executeQurery()改成execute() 那显然问题出在execu...

Lanly-Li的博客 2万+

svn 分支(branch)和标签(tag)管理

svn的分支管理

caohongxing的博客 3万+

RK3588开发板实战:从零开始移植Ubuntu 24.04(讯为SDK版)

本文详细介绍了如何在RK3588开发板上从零开始移植Ubuntu 24.04系统(讯为SDK版),涵盖开发环境准备、SDK解析、根文件系统定制、驱动适配、系统集成与烧录等全流程。通过实战案例,帮助开发者快速掌握RK3588开发板的系统移植技巧,适用于嵌入式开发与定制化Linux系统构建。

sand8的博客 436

Can not issue data manipulation statements with executeQuery()错误解决

强烈建议:尽信书,不如无书!!!    下午没事,就练习了下连接数据库,结果发现了一个问题,哈哈 Can not issue data manipulation statements with executeQuery()   原因是这句:st.executeQuery("insert  into  student  values('"+name+"','"+age+"','"+intr

学习那点事儿 16万+

软考29-上午题-【数据结构】-排序

数据结构7种排序

qq_31532983的博客 1579

断点失效:Eclipse Unable to install breakpoint in XXX 解决办法

Eclipse debug 断点不能调试 ,Eclipse Unable to install breakpoint in 解决办法解决:【1】项目工程名 ,右键 --》 properties --》 java compiler --》class file Generation 位置 Add line number attributes to generated class files 打钩...

Diligence is the mother of success. 2万+

别再死记硬背了!用Python可视化带你直观理解柯西收敛定理(附NumPy代码)

本文通过Python可视化技术,结合NumPy和Matplotlib,直观展示柯西收敛定理的动态过程。文章提供了完整的代码实现,帮助读者从抽象数学定义过渡到具象理解,特别适合数学学习者和Python开发者。通过热力图和交互式参数探索,读者可以清晰观察数列收敛特性,提升数学分析的学习效率。

weixin_28465009的博客 185

深入详解DICOM医学影像定位线相关知识:理解定位线的概念、定位线的作用以及定位线显示和计算原理

深入详解DICOM医学影像定位线相关知识:理解定位线的概念、定位线的作用以及定位线显示和计算原理

编程技术探索者,分享C/C++、C#、Java、数据库等开发经验,聚焦实战技巧与AI兴趣,助力编程爱好者成长。 2052

FAQ(41):Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:

FAQ(41):### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b.providerId=1,b.

Diligence is the mother of success. 1万+

机器学习的低代码与无代码平台:便捷入门之路

机器学习领域正涌现出大量低代码和无代码平台,使非技术人员也能轻松应用AI技术。低代码平台(如PyCaret、H2O AutoML)需少量编程但灵活性强,而无代码工具(如Google Cloud AutoML、Teachable Machine)则完全无需编程基础。这些平台覆盖图像识别、文本处理、业务预测等多种场景,适合快速部署简单项目。但专业人士仍需注意,这些工具无法替代复杂场景下的定制化开发。随着技术进步,低门槛AI工具正在改变各行业的创新方式。

2501_90323865的博客 154

FAQ(4):javaee使用mybatis,org.apache.ibatis.io.Resources报错

FAQ(4):javaee使用mybatis,org.apache.ibatis.io.Resources报错

Diligence is the mother of success. 1万+

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

FAQ(40):org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.m

FAQ(40):org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'creationDate' in 'field list' ### The error may involve com.smbms.dao.UserMapper.add-I

Diligence is the mother of success. 1万+

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

FAQ(69):java.lang.IllegalStateException: Cannot convert value of type ‘java.lang.String‘ to required

FAQ(69):java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.alibaba.fastjson.serializer.SerializerFeature' for property 'features[0]': no matching editors or conversion strategy found

Diligence is the mother of success. 1万+

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

FAQ(8):org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: ja

FAQ(8):org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: ja

Diligence is the mother of success. 9894

SpringMVC-FAQ(1):HTTP Status 500 - Servlet.init() for servlet DispatcherServlet threw exception

SpringMVC-FAQ(1):HTTP Status 500 - Servlet.init() for servlet DispatcherServlet threw exception

Diligence is the mother of success. 8445

FAQ(88): The HTTP response from the server [404] did not permit the HTTP upgrade to WebSocket?

2019年9月10日 这天部署服务器后,发现websocket 出现连接异常,这里摘取部分重要log。 log: java.util.concurrent.ExecutionException: javax.websocket.DeploymentException: The HTTP response from the server [404] did not permit the HT...

Diligence is the mother of success. 7579

FAQ(59):java.text.ParseException: Unparseable date: “Wed Jan 24 16:28:14 CST 2018“

FAQ(59):java.text.ParseException: Unparseable date: "Wed Jan 24 16:28:14 CST 2018"

Diligence is the mother of success. 6170

FAQ(12):Error querying database. Cause: java.sql.SQLException

FAQ(12):Error querying database. Cause: java.sql.SQLException

Diligence is the mother of success. 5318

SpringMVC-FAQ(2):java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapa

SpringMVC-FAQ(2):java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapa

Diligence is the mother of success. 4747

FAQ(67):java.sql.SQLException: You have an error in your SQL syntax; check the manual that correspon

FAQ(67):java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where id=2' at line 1

Diligence is the mother of success. 4361

FAQ(61):java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider

FAQ(61):java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider

Diligence is the mother of success. 4211

FAQ(69):Missing artifact com.alipay:alipay-sdk:jar:1.0

2018年8月31日15:39:12 解决:导入maven的pom.xml正确后解决。 先去maven的指定路径(公认的jar包路径)寻找并下载jar包:         <dependency>             <groupId>mysql</groupId>             <artifactId>mysql-connector...

Diligence is the mother of success. 3915

FAQ(7):IOException parsing XML document from ServletContext resource [/calsspath:springmvc.xml];

FAQ(7):IOException parsing XML document from ServletContext resource [/calsspath:springmvc.xml];

Diligence is the mother of success. 3465
上一篇: SpringMVC(20):数据校验功能 -- 使用JSR303实现服务器端的数据校验
下一篇: FAQ(58):com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'createDate'
后台技术汇
博客等级 码龄11年 670粉丝 531原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

后台技术汇

对你的帮助,是对我的最好鼓励。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值