- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在运行 SQL 查询时遇到问题。我有多个这样的查询,但只有这个不起作用。这是我的错误:
06/16/20 19:54:05.808 INFO Camel (camel-1) thread #25 - JmsConsumer[AUDIT_EVENT] com.jcabi.log.Logger - #handle('StudyDispatchEvent{workstationId=151611, accelera..1053..Context='null', eventType=STUDY_DISPATCH}'): thrown org.springframework.jdbc.BadSqlGrammarException(PreparedStatementCallback; bad SQL grammar [ INSERT INTO smr_dicom_push_events (event_id, study_id, accel_name, accel_recv_ch_name, ip_address, port, ae_title, workstation_log_id, from_rule) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); ]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: invalid character ) out of org.springframework.jdbc.support.SQLExceptionSubclassTranslator#doTranslate[93] in 10ms
06/16/20 19:54:05.837 ERROR Camel (camel-1) thread #25 - JmsConsumer[AUDIT_EVENT] org.apache.camel.util.CamelLogger - Failed delivery for (MessageId: ID:43d1a8f8-ca9a-4fa7-b50f-89fbb07d7e3d:5:1:1-9 on ExchangeId: ID-psh-app-audit-event-handler-6889655f7d-nzpd4-1592329533949-0-34). Exhausted after delivery attempt: 1 caught: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ INSERT INTO smr_dicom_push_events (event_id, study_id, accel_name, accel_recv_ch_name, ip_address, port, ae_title, workstation_log_id, from_rule) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); ]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: invalid character . Processed by failure processor: FatalFallbackErrorHandler[Channel[DelegateSync[com.nuance.powershare.audit.event.handler.service.gateway.AuditEventMessageGateway$$Lambda$613/2123960023@756d127a]]] Message History --------------------------------------------------------------------------------------------------------------------------------------- RouteId ProcessorId Processor Elapsed (ms) [route1 ] [route1 ] [amqp://AUDIT_EVENT ] [ 44] [route1 ] [bean2 ] [bean[com.nuance.diag.common.messaging.service.adapter.DataCompressionServiceAd] [ 1] [route1 ] [bean3 ] [bean[com.nuance.diag.common.messaging.service.adapter.DataMapperServiceAdapter] [ 4] [route1 ] [bean4 ] [bean[com.nuance.powershare.audit.event.handler.service.adapter.AuditEventHandl] [ 38] [route1 ] [process1 ] [Processor@0x756d127a ] [ 21] Exchange --------------------------------------------------------------------------------------------------------------------------------------- Exchange[ Id ID-psh-app-audit-event-handler-6889655f7d-nzpd4-1592329533949-0-34 ExchangePattern InOnly Headers {breadcrumbId=ID-psh-app-audit-event-handler-6889655f7d-nzpd4-1592329533949-0-34, ContentType=application/json, DataType=STUDY_DISPATCH, JMSCorrelationID=null, JMSCorrelationIDAsBytes=null, JMSDeliveryMode=1, JMSDestination=AUDIT_EVENT, JMSExpiration=0, JMSMessageID=ID:43d1a8f8-ca9a-4fa7-b50f-89fbb07d7e3d:5:1:1-9, JMSPriority=4, JMSRedelivered=false, JMSReplyTo=null, JMSTimestamp=1592337245787, JMSType=null, JMSXDeliveryCount=1, JMSXGroupID=null, JMSXUserID=null} BodyType com.nuance.powershare.audit.event.model.StudyDispatchEvent Body StudyDispatchEvent{workstationId=151611, acceleratorName='3021AzDev', receivingChannelName='3021AzDev', ipAddress='10.0.0.34', port=6666, aeTitle='sendtopacs', isFromRule=true, priority=20, action=enqueue} StudyEvent{study=AuditStudy{id=14255648, studyUid='2.25.216144697767951623307700654550131549107', ibId=120912, studyDate=null, creationDate=null, patient=AuditPatient{id=319213}, accessionNumber='an123456', institutionName='Automation,Inc', modality='US', bodyPartsExamined='all Parts', studyDescription='This is a test study', referringPhysicianName='Dr Anderson'}} AuditEvent{actionAccount=AuditAccount{id=116233, accountName='API AutoPush Owner Account', user=AuditUser{id=125716, firstName='Owner', lastName='AutoPush', email='nuancepshapi+AutoPushOwner@gmail.com'}, repositoryId=null, ibId=null}, ownerAccount=AuditAccount{id=116233, accountName='API AutoPush Owner Account', user=AuditUser{id=125716, firstName='Owner', lastName='AutoPush', email='nuancepshapi+AutoPushOwner@gmail.com'}, repositoryId=null, ibId=null}, recipientAccount=null, custodianAccount=null, impersonatorAccount=null, requestContext='null', eventType=STUDY_DISPATCH} ] Stacktrace ---------------------------------------------------------------------------------------------------------------------------------------
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [
INSERT INTO smr_dicom_push_events (event_id, study_id, accel_name, accel_recv_ch_name, ip_address,
port, ae_title, workstation_log_id, from_rule)
VALUES (?, ?, ?, ?, ?,
?, ?, ?, ?);
]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:93)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
...
...
我不确定为什么会发生这种情况。我知道所有的值都是有效的。我可以猜测的一件事是,在 sql 查询的末尾有分号。但我不知道。我做错了什么?
编辑:我可以猜测的另一个问题是“from_rule”在代码中作为 boolean 值传递,但在sql表中它是NUMBER(0,1)。我不确定这种转换是否有效。
最佳答案
不熟悉 java 库,但在 ip_address,
和 ?,
处返回似乎有问题。
关于java - Sql 抛出 org.springframework.jdbc.BadSqlGrammarException(PreparedStatementCallback; 错误的 SQL 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62432043/
@Transactional public Boolean save(final StudentLogEntry studentLogEntry) throws SQLException,Da
我一直在尝试使用 Postgres 数据库进行 Spring 安全性身份验证。 这是我的 SQL 表定义: CREATE TABLE "UTILISATEUR" ( "IdUtilisateur" s
我有一个关于PreparedStatementCallback的问题,如下所示: Error! Conflict [#409]: PreparedStatementCallback; SQL [EX
我的要求是搜索存储在 DB2 中的目的地列表,当我输入一个字符或字符列表时,我使用的是 jquery 自动完成和 ajax 调用。一旦我在目标文本框中输入一个字符或字符串,它应该通过查询 DB2 来检
我在运行 SQL 查询时遇到问题。我有多个这样的查询,但只有这个不起作用。这是我的错误: 06/16/20 19:54:05.808 INFO Camel (camel-1) thread #25
我想要 Spring Batch 元数据 在 MySQL 服务器上创建并使用所有来自 Oracle 的现有表从中获取数据并将其放入 MongoDB。 我创建了以下配置,但不知何故错过了通过配置创建 S
我正在运行一个带有 Spring BootSecurtiy 的 Spring Boot 应用程序,即身份验证管理器构建器。登录应该由数据库的实体完成。但是每当我登录时它都会显示以下错误。 Prepar
我正在开发 Spring Batch Example – CSV File To MySQL Database 示例。我开发了整个代码,但是当我运行代码时,我看到出现以下错误。 我原以为 spring
我是一名优秀的程序员,十分优秀!