- 浏览: 680635 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (302)
- 知识库 (51)
- lucene (8)
- 数据结构 (7)
- 问题及解决方法 (97)
- Quartz (4)
- JavaScript (26)
- java 基础 (40)
- 休闲 (9)
- 数据库相关 (32)
- 面试题 (4)
- Hibernate (5)
- Struts (11)
- JBPM (2)
- Spring (3)
- ajax (7)
- Flex (0)
- 报表 (4)
- 打印 (2)
- prototype (3)
- Struts2 (3)
- JQUERY (4)
- Ruby (0)
- Linux (9)
- Android (3)
- Objective-c (2)
- Python (8)
- map (1)
- mybatis (3)
- php (2)
- ios (0)
- 问题及解决方法 struts2 spring ognl resion tomcat (0)
- 问题及解决方法 struts2 spring ognl resin tomcat (1)
- c++ (2)
- 问题及解决方法 upload.parseRequest(request) 为空 (1)
- Eclipse maven tomcat (1)
- 知识库 服务器配置 (1)
- sersync2 (1)
- Maven Jetty Plugin 配置指南(翻译) (1)
最新评论
-
jgroups:
...
遇到Causedby:java.lang.NoClassDefFoundError:javax/validation/ParameterNameProvider -
dmyccc:
第二种方法还是很佩服楼主的,但是多少感觉有点投机取巧了。但是确 ...
spring mvc整合kindeditor文件上传问题 -
du_bo:
在xx-servlet.xml中这样配置<bean id ...
spring mvc整合kindeditor文件上传问题 -
java梦之翼:
太感谢了, 问题得到解决, 感谢
异常org.mybatis.spring.transaction.SpringManagedTransactionFactory.newTransaction -
du_bo:
这是我的上传package com.sp.controller ...
spring mvc整合kindeditor文件上传问题
SQLState: S0022
StringBuffer sb = new StringBuffer(); sb.append(" select {m.*} from d_provider_to_factory as d , m_enterprice as m where 1=1 "); if ("0".equals(enterpriceType)) { sb.append(" and d.provider_id = m.enterprice_id "); }else if("1".equals(enterpriceType)){ sb.append(" and d.factory_id = m.enterprice_id "); } sb.append(" and m.flag_del = '0' "); sb.append(" and d.flag_del = '0' "); if ("0".equals(enterpriceType)) { sb.append(" group by d.provider_id "); }else if("1".equals(enterpriceType)){ sb.append(" group by d.factory_id "); } if (page <=0) { page = 1; } String sql = sb.toString(); sb = null; Session session = getSession(); List pList = session.createSQLQuery(sql) .addEntity("d", DProviderToFactory.class) .addEntity("m",MEnterprice.class) .setFirstResult((page-1)*pageSize) .setMaxResults(pageSize) .list();
执行的时候 报错:
Hibernate: select m.enterprice_id as enterprice1_84_1_, m.enterprice_name as enterprice2_84_1_, m.enterprice_short_name as enterprice3_84_1_, m.enterprice_original_name as enterprice4_84_1_, m.parent_enterprice_id as parent5_84_1_, m.trade_type as trade6_84_1_, m.province_id as province7_84_1_, m.administrative_division as administ8_84_1_, m.address as address84_1_, m.post_code as post10_84_1_, m.enterprise_type as enterprise11_84_1_, m.corporate_representative as corporate12_84_1_, m.fax as fax84_1_, m.phone_number as phone14_84_1_, m.cell_phone_number as cell15_84_1_, m.email as email84_1_, m.begin_date as begin17_84_1_, m.register_capital as register18_84_1_, m.operate_begin_date as operate19_84_1_, m.operate_end_date as operate20_84_1_, m.register_department as register21_84_1_, m.tax_number as tax22_84_1_, m.register_code as register23_84_1_, m.operate_area as operate24_84_1_, m.remark as remark84_1_, m.flag_del as flag26_84_1_, m.create_datetime as create27_84_1_, m.create_date_user as create28_84_1_, m.update_datetime as update29_84_1_, m.update_date_user as update30_84_1_ from d_provider_to_factory as d , m_enterprice as m where 1=1 and d.factory_id = m.enterprice_id and m.flag_del = '0' and d.flag_del = '0' group by d.factory_id 2011-07-06 15:44:29,595 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 0, SQLState: S0022 2011-07-06 15:44:29,595 ERROR [org.hibernate.util.JDBCExceptionReporter] - Column 'provider1_83_0_' not found. org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2223) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) at cn.com.jdlh.enterprice.dao.EnterPriceDAO.getEnterPriceList(EnterPriceDAO.java:62) at cn.com.jdlh.enterprice.dao.EnterPriceDAO$$FastClassByCGLIB$$4c9aae10.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at cn.com.jdlh.enterprice.dao.EnterPriceDAO$$EnhancerByCGLIB$$dffb0954.getEnterPriceList(<generated>) at cn.com.jdlh.enterprice.action.EnterPriceAction.enterPriceList(EnterPriceAction.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at filters.SecurityFilter.doFilter(SecurityFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:267) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:245) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:260) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: Column 'provider1_83_0_' not found. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:987) at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2749) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getInt(NewProxyResultSet.java:2573) at org.hibernate.type.IntegerType.get(IntegerType.java:28) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154) at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1097) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:565) at org.hibernate.loader.Loader.doQuery(Loader.java:701) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) ... 95 more
我将 Hibernate 打印出来的SQL 拿出来可以单独执行,但是 放到程序里就出错了。
最后找到问题根源
List pList = session.createSQLQuery(sql) //.addEntity("d", DProviderToFactory.class) .addEntity("m",MEnterprice.class) .setFirstResult((page-1)*pageSize) .setMaxResults(pageSize) .list();
因为 我不需要 查询出 d 实体的内容 所以 就不用吧 d也实例化 将
//.addEntity("d", DProviderToFactory.class)
注释掉 就可以了。
如果不注释掉 也行 就修改sql 语句
StringBuffer sb = new StringBuffer();
sb.append(" select {m.*} ,{d.*} from d_provider_to_factory as d , m_enterprice as m where 1=1 ");
if ("0".equals(enterpriceType)) {
sb.append(" and d.provider_id = m.enterprice_id ");
}else if("1".equals(enterpriceType)){
sb.append(" and d.factory_id = m.enterprice_id ");
}
sb.append(" and m.flag_del = '0' ");
sb.append(" and d.flag_del = '0' ");
if ("0".equals(enterpriceType)) {
sb.append(" group by d.provider_id ");
}else if("1".equals(enterpriceType)){
sb.append(" group by d.factory_id ");
}
if (page <=0) {
page = 1;
}
String sql = sb.toString();
sb = null;
Session session = getSession();
List pList = session.createSQLQuery(sql)
.addEntity("d", DProviderToFactory.class)
.addEntity("m",MEnterprice.class)
.setFirstResult((page-1)*pageSize)
.setMaxResults(pageSize)
.list();
总结:如果非要用hibernate查询sql 语句并且进行自动映射的话,最好用到那个实体就添加那个实体。
发表评论
-
CentOS升级Python到2.7 遇到的问题 输入发不见了
2014-12-11 18:42 862CentOS 6.6 上安装的python版本是2.6,不 ... -
unable to ping server at localhost:1099
2014-12-10 10:30 5894开始使用linux开发环境,在配置idea 下tomcat ... -
Maven使用FAQ:与Maven版本和字符集编码有关的编译错误处理
2014-08-25 18:28 715在Maven3.0下创建了一个POM文件,可对项目进行正常的 ... -
遇到Causedby:java.lang.NoClassDefFoundError:javax/validation/ParameterNameProvider
2014-08-06 10:19 14226. 由于hibernate-validator-5.x.x ... -
Eclipse中导入或者Update Maven Project时的Null Pointer Exceptio
2014-03-19 11:02 835有时在Eclipse中导入Maven的Projects时,或 ... -
The reference to entity "characterEncoding" must end with the ';' delimiter
2014-01-13 15:04 1066数据源配置时加上编码转换格式后出问题了: The r ... -
java 图片涂抹功能
2013-12-30 16:19 1494今天遇到一个问题,用户上传图片的时候,有些敏感信息 ... -
Maven Jetty Plugin 配置指南(翻译)
2013-10-26 13:20 1117Jetty 版本信息 J ... -
jdk 1.6 下载地址
2013-10-16 14:14 864https://jdk6.java.net/download. ... -
java 截取汉字字符串
2013-10-11 11:49 1420对于汉字的切分 1个 汉字 占用2个字符 不能切出半 ... -
Spring MVC json 406 Not Acceptable
2013-09-12 17:41 1169使用SPring MVC 处理json 的时候老是 406 ... -
springMVC No mapping found for HTTP request with URI
2013-08-14 18:51 1202No mapping found for HTTP requ ... -
JSON和JSONP
2013-08-01 11:53 932由于Sencha Touch 2这种开 ... -
Eclipse 运行 maven web 项目
2013-07-19 14:00 20669eclipse 运行 maven web 项目 有两种方 ... -
Spring的quartz定时器同一时刻重复执行二次的问题解决
2013-07-18 17:49 1737最近用Spring的quartz定时器的时 ... -
Python2.7 安装 beautifulsoup4-4.2.1
2013-07-15 11:53 3047一个BeautifulSoup的模块,下载的是bea ... -
通过maven在eclipse中直接关联源码包
2013-07-01 16:21 965通过maven在eclipse中直接关联源码包 1、使用命 ... -
unicode 和 汉字转换
2013-06-18 15:23 1515// unicode转为本地 public sta ... -
eclipse freemarker 插件
2013-05-26 15:32 1195在写freemarkder 插件地址:http:// ... -
myeclipse maven plugin 插件 安装 和 配置
2013-05-15 17:34 2845环境: ...
相关推荐
SQLSTATE 错误码查表 SQLSTATE 错误码是 SQL 语句执行过程中出现的错误代码,它们是标准化的错误代码,可以帮助开发者快速地定位和解决问题。本文档提供了 SQLSTATE 错误码的详细信息,包括错误代码、错误描述和...
* Error 1009:SQLSTATE: HY000 (ER_DB_DROP_DELETE) Message: Error dropping database (can't delete '%s', errno: %d) * Error 1010:SQLSTATE: HY000 (ER_DB_DROP_RMDIR) Message: Error dropping database (can...
- **消息**:`将 '%s' 重命名为 '%s' 时出错 (errno:%d)` - **解释**:在尝试重命名文件时遇到错误,可能是由于目标文件已存在或其他权限问题。 27. **错误:1026 SQLSTATE: HY000 (ER_ERROR_ON_WRITE)** - **...
**GBase 8s SQL 指南:教程** GBase 8s是南大通用数据系统有限公司开发的一款高性能、高可用性的国产化数据库管理系统,主要用于满足大规模数据处理和分析的需求。作为一款关系型数据库,它支持SQL(结构化查询语言...
警告: SQL Error: 156, SQLState: S0001 org.hibernate.exception.SQLGrammarException: could not execute query org.hibernate.util.JDBCExceptionReporter logExceptions 严重: 关键字 'user' 附近有语法错误。...
在SQL数据库操作中,我们可能会遇到各种错误代码,其中SQLSTATE=57016 SQLCODE=-668是一个常见的错误,特别是在IBM DB2数据库系统中。这个错误通常表示一个操作无法执行,因为对象(如表)正被其他事务占用或者处于...
- **1004 SQLSTATE: HY000**:信息为“Can't create file '%s' (errno: %d)”,表明无法创建指定文件,其中的 `%s` 和 `%d` 分别代表文件名和错误码。 - **1005 SQLSTATE: HY000**:信息为“Can't create table '%s'...
- "Batch Abend Codes"中的Sxxx Uxxxx:S代表“系统”,U代表“用户”。例如,"subscript out of range"意味着访问COBOL数组时下标越界,可能导致内存破坏和后续错误。 7. **解决问题**: - 分析SQLCode和...
#### SQLSTATE消息概述 在DB2中,SQLSTATE是一种标准的错误报告机制,用于指示SQL语句执行时的状态。这些状态被编码为五字符的字母数字组合,用于帮助诊断问题。每个状态都有特定的意义,并对应于不同的错误或警告...
错误提示“(s)netlib”表明在执行网络操作时出现了问题。 4. SQLSetPos:这是SQL Server中的一个API函数,用于定位在结果集中的行,并且设置行的锁定模式。文档中多次提到SQLSetPos,可能在某些操作中因为定位或...
错误消息:将'%s'重命名为'%s'时出错(errno:%d) 解释:在尝试重命名文件时发生错误,原因可能是权限不足或目标文件名已存在。 27. ER_ERROR_ON_WRITE(错误码:1026) 错误消息:写入文件'%s'时出错(errno:%d) 解释...
这份文档,"mysql常见错误与标准错误对照表.docx",提供了一个详细的错误代码和对应的SQLSTATE代码,帮助用户理解和解决MySQL中遇到的问题。以下是部分常见的MySQL错误及其解释: 1. **错误1011HY000**: "Error on ...
CAST(s_rtcd AS CHAR(5)) || '--sqlstate:' || s_rtst; -- 进一步处理或退出 END IF; END; ``` #### 五、命名规范 **1. 存储过程命名** - 命名应简短且有意义,最好能反映存储过程的功能。 - 遵循一定的命名...
**问题描述**:通过Gbase JDBC连接单个数据库时出现异常:“SQLException: Server configuration denies access to data source, SQLState: 08001, VendorError: 0”。 **解决方案**: 1. **权限检查**:首先确保...
Adaptive Server Enterprise ...,%)-./ 012) SQLSTATE 34 56789:; >? Transact-SQL @ABC:DEFG#$H I JKL M >?NOPQR Transact-SQL S TU V WX YZ S[\>? Transact-SQL ]^ _`ab c
### SQL Server 2812错误处理 #### 一、问题背景 在SQL Server数据库管理过程中,用户可能会遇到“错误2812:未能找到存储过程'master.dbo.xp_fileexist'”的问题。该问题通常发生在尝试还原数据库时,其原因是系统...
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '课程名不能与其他课程相同'; END IF; END$$ DELIMITER ; ``` #### 六、用户与权限管理(10分) - **知识点**: 使用`GRANT`语句创建用户并授予权限。 - **示例**...