NutzCN Logo
问答 java.sql.SQLException: ORA-00905: 缺失关键字 oracle
发布于 1593天前 作者 Hamming 1804 次浏览 复制 上一个帖子 下一个帖子
标签:

Java 代码如下其他 数据库 能运行 oracle 执行异常

    @At
    @Ok("json")
    public Object list(@Param("pageNum")Integer pageNum,
                       @Param("pageSize")Integer pageSize,
                       @Param("deptId") String deptId,
                       @Param("loginName") String loginName,
                       @Param("phonenumber") String phonenumber,
                       @Param("beginTime") Date beginTime,
                       @Param("endTime") Date endTime,
                       @Param("orderByColumn") String orderByColumn,
                       @Param("isAsc") String isAsc,
                       HttpServletRequest req) {
        Cnd cnd = Cnd.NEW();
        if (!Strings.isBlank(loginName)) {
            cnd.and("user_name", "like", "%" + loginName + "%");
        }
        if (!Strings.isBlank(phonenumber)) {
            cnd.and("phonenumber", "=", phonenumber);
        }
        if (Lang.isNotEmpty(beginTime)) {
            cnd.and("create_time", ">=", beginTime);
        }
        if (Lang.isNotEmpty(endTime)) {
            cnd.and("create_time", "<=", endTime);
        }
        if (!Strings.isBlank(deptId)) {
            cnd.where().andInBySql("dept_id", "SELECT id FROM sys_dept  WHERE FIND_IN_SET ('%s',ancestors)", deptId)
                    .or("dept_id", "=", deptId);
        }
        return userService.tableList(pageNum, pageSize, cnd, orderByColumn, isAsc, "dept");
    }
    /**
     * 分页查询数据封装 查询关联数据
     *
     * @param pageNumber
     * @param pageSize
     * @param cnd
     * @param linkname
     * @return
     */
    @Override
    public TableDataInfo tableList(Integer pageNumber, Integer pageSize, Cnd cnd, String orderByColumn, String isAsc, String linkname) {
        Pager pager=null;
        if(Lang.isNotEmpty(pageNumber) && Lang.isNotEmpty(pageSize)){
            pager = this.dao().createPager(pageNumber, pageSize);
        }
        if (Strings.isNotBlank(orderByColumn) && Strings.isNotBlank(isAsc)) {
            MappingField field = dao().getEntity(this.getEntityClass()).getField(orderByColumn);
            if (Lang.isNotEmpty(field)) {
                cnd.orderBy(field.getColumnName(), isAsc);
            }
        }
        if (Strings.isBlank(linkname)) {
            List<T> list = this.dao().query(this.getEntityClass(), cnd, pager);
            return new TableDataInfo(list, this.dao().count(this.getEntityClass(), cnd));
        } else {
            List<T> list = this.dao().queryByJoin(this.getEntityClass(), linkname, cnd, pager);
            return new TableDataInfo(list, this.dao().count(this.getEntityClass(), cnd));
        }
    }

异常信息

[DEBUG] 20:40:05.154 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM (SELECT T.*, ROWNUM RN FROM ( SELECT sys_user.id as id,sys_user.dept_id as dept_id,sys_user.login_name as login_name,sys_user.user_name as user_name,sys_user.password as password,sys_user.salt as salt,sys_user.email as email,sys_user.phonenumber as phonenumber,sys_user.gender as gender,sys_user.avatar as avatar,sys_user.status as status,sys_user.del_flag as del_flag,sys_user.login_ip as login_ip,sys_user.login_date as login_date,sys_user.create_by as create_by,sys_user.create_time as create_time,sys_user.update_by as update_by,sys_user.update_time as update_time , dept.id as dept_z_id,dept.parent_id as dept_z_parent_id,dept.ancestors as dept_z_ancestors,dept.dept_name as dept_z_dept_name,dept.order_num as dept_z_order_num,dept.leader as dept_z_leader,dept.phone as dept_z_phone,dept.email as dept_z_email,dept.status as dept_z_status,dept.del_flag as dept_z_del_flag,dept.create_by as dept_z_create_by,dept.create_time as dept_z_create_time,dept.update_by as dept_z_update_by,dept.update_time as dept_z_update_time FROM sys_user LEFT JOIN sys_dept as dept ON sys_user.dept_id = dept.id  WHERE dept_id IN (SELECT id FROM sys_dept  WHERE FIND_IN_SET ('104',ancestors)) OR dept_id=? ORDER BY create_time DESC  ) T WHERE ROWNUM <= 10) WHERE RN > 0 
    |   1 |
    |-----|
    | 104 |
  For example:> "SELECT * FROM (SELECT T.*, ROWNUM RN FROM ( SELECT sys_user.id as id,sys_user.dept_id as dept_id,sys_user.login_name as login_name,sys_user.user_name as user_name,sys_user.password as password,sys_user.salt as salt,sys_user.email as email,sys_user.phonenumber as phonenumber,sys_user.gender as gender,sys_user.avatar as avatar,sys_user.status as status,sys_user.del_flag as del_flag,sys_user.login_ip as login_ip,sys_user.login_date as login_date,sys_user.create_by as create_by,sys_user.create_time as create_time,sys_user.update_by as update_by,sys_user.update_time as update_time , dept.id as dept_z_id,dept.parent_id as dept_z_parent_id,dept.ancestors as dept_z_ancestors,dept.dept_name as dept_z_dept_name,dept.order_num as dept_z_order_num,dept.leader as dept_z_leader,dept.phone as dept_z_phone,dept.email as dept_z_email,dept.status as dept_z_status,dept.del_flag as dept_z_del_flag,dept.create_by as dept_z_create_by,dept.create_time as dept_z_create_time,dept.update_by as dept_z_update_by,dept.update_time as dept_z_update_time FROM sys_user LEFT JOIN sys_dept as dept ON sys_user.dept_id = dept.id  WHERE dept_id IN (SELECT id FROM sys_dept  WHERE FIND_IN_SET ('104',ancestors)) OR dept_id='104' ORDER BY create_time DESC  ) T WHERE ROWNUM <= 10) WHERE RN > 0 "
[DEBUG] 20:40:05.165 org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:103) - SQLException
java.sql.SQLException: ORA-00905: 缺失关键字

	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:879)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3608)
	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3652)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1207)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3240)
	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3237)
	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:181)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:275)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:59)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:65)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:63)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:138)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:163)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:130)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:97)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:86)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:242)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:254)
	at org.nutz.dao.impl.NutDao.queryByJoin(NutDao.java:1284)
	at org.nutz.dao.impl.NutDao.queryByJoin(NutDao.java:1274)
	at io.nutz.nutzsite.common.service.BaseServiceImpl.tableList(BaseServiceImpl.java:494)
	at io.nutz.nutzsite.module.sys.controllers.UserController.list(UserController.java:85)
	at io.nutz.nutzsite.module.sys.controllers.UserController$FM$list$47dddca2a1b555c85985838b797cc436.invoke(UserController.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.plugins.validation.ValidationProcessor.process(ValidationProcessor.java:56)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:38)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at io.nutz.nutzsite.common.mvc.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:80)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:139)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at io.nutz.nutzsite.common.mvc.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:48)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:500)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.lang.Thread.run(Thread.java:748)
[WARN ] 20:40:05.166 io.nutz.nutzsite.common.mvc.processor.ErrorProcessor.process(ErrorProcessor.java:43) - Error@/sys/user/list :
org.nutz.dao.DaoException: !Nutz SQL Error: 'SELECT * FROM (SELECT T.*, ROWNUM RN FROM ( SELECT sys_user.id as id,sys_user.dept_id as dept_id,sys_user.login_name as login_name,sys_user.user_name as user_name,sys_user.password as password,sys_user.salt as salt,sys_user.email as email,sys_user.phonenumber as phonenumber,sys_user.gender as gender,sys_user.avatar as avatar,sys_user.status as status,sys_user.del_flag as del_flag,sys_user.login_ip as login_ip,sys_user.login_date as login_date,sys_user.create_by as create_by,sys_user.create_time as create_time,sys_user.update_by as update_by,sys_user.update_time as update_time , dept.id as dept_z_id,dept.parent_id as dept_z_parent_id,dept.ancestors as dept_z_ancestors,dept.dept_name as dept_z_dept_name,dept.order_num as dept_z_order_num,dept.leader as dept_z_leader,dept.phone as dept_z_phone,dept.email as dept_z_email,dept.status as dept_z_status,dept.del_flag as dept_z_del_flag,dept.create_by as dept_z_create_by,dept.create_time as dept_z_create_time,dept.update_by as dept_z_update_by,dept.update_time as dept_z_update_time FROM sys_user LEFT JOIN sys_dept as dept ON sys_user.dept_id = dept.id  WHERE dept_id IN (SELECT id FROM sys_dept  WHERE FIND_IN_SET ('104',ancestors)) OR dept_id='104' ORDER BY create_time DESC  ) T WHERE ROWNUM <= 10) WHERE RN > 0 '
PreparedStatement: 
'SELECT * FROM (SELECT T.*, ROWNUM RN FROM ( SELECT sys_user.id as id,sys_user.dept_id as dept_id,sys_user.login_name as login_name,sys_user.user_name as user_name,sys_user.password as password,sys_user.salt as salt,sys_user.email as email,sys_user.phonenumber as phonenumber,sys_user.gender as gender,sys_user.avatar as avatar,sys_user.status as status,sys_user.del_flag as del_flag,sys_user.login_ip as login_ip,sys_user.login_date as login_date,sys_user.create_by as create_by,sys_user.create_time as create_time,sys_user.update_by as update_by,sys_user.update_time as update_time , dept.id as dept_z_id,dept.parent_id as dept_z_parent_id,dept.ancestors as dept_z_ancestors,dept.dept_name as dept_z_dept_name,dept.order_num as dept_z_order_num,dept.leader as dept_z_leader,dept.phone as dept_z_phone,dept.email as dept_z_email,dept.status as dept_z_status,dept.del_flag as dept_z_del_flag,dept.create_by as dept_z_create_by,dept.create_time as dept_z_create_time,dept.update_by as dept_z_update_by,dept.update_time as dept_z_update_time FROM sys_user LEFT JOIN sys_dept as dept ON sys_user.dept_id = dept.id  WHERE dept_id IN (SELECT id FROM sys_dept  WHERE FIND_IN_SET ('104',ancestors)) OR dept_id=? ORDER BY create_time DESC  ) T WHERE ROWNUM <= 10) WHERE RN > 0 '
CaseMessage=ORA-00905: 缺失关键字

	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:110)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:65)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:63)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:138)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:163)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:130)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:97)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:86)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:242)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:254)
	at org.nutz.dao.impl.NutDao.queryByJoin(NutDao.java:1284)
	at org.nutz.dao.impl.NutDao.queryByJoin(NutDao.java:1274)
	at io.nutz.nutzsite.common.service.BaseServiceImpl.tableList(BaseServiceImpl.java:494)
	at io.nutz.nutzsite.module.sys.controllers.UserController.list(UserController.java:85)
	at io.nutz.nutzsite.module.sys.controllers.UserController$FM$list$47dddca2a1b555c85985838b797cc436.invoke(UserController.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.plugins.validation.ValidationProcessor.process(ValidationProcessor.java:56)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:38)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at io.nutz.nutzsite.common.mvc.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:80)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:139)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at io.nutz.nutzsite.common.mvc.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:48)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:500)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: ORA-00905: 缺失关键字

	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:879)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3608)
	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3652)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1207)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3240)
	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3237)
	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:181)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:275)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:59)
	... 84 more

这个算不算bug呢

4 回复

SQL 执行

SELECT
  sys_user.id          as id,
  sys_user.dept_id     as dept_id,
  sys_user.login_name  as login_name,
  sys_user.user_name   as user_name,
  sys_user.password    as password,
  sys_user.salt        as salt,
  sys_user.email       as email,
  sys_user.phonenumber as phonenumber,
  sys_user.gender      as gender,
  sys_user.avatar      as avatar,
  sys_user.status      as status,
  sys_user.del_flag    as del_flag,
  sys_user.login_ip    as login_ip,
  sys_user.login_date  as login_date,
  sys_user.create_by   as create_by,
  sys_user.create_time as create_time,
  sys_user.update_by   as update_by,
  sys_user.update_time as update_time,
  dept.id              as dept_z_id,
  dept.parent_id       as dept_z_parent_id,
  dept.ancestors       as dept_z_ancestors,
  dept.dept_name       as dept_z_dept_name,
  dept.order_num       as dept_z_order_num,
  dept.leader          as dept_z_leader,
  dept.phone           as dept_z_phone,
  dept.email           as dept_z_email,
  dept.status          as dept_z_status,
  dept.del_flag        as dept_z_del_flag,
  dept.create_by       as dept_z_create_by,
  dept.create_time     as dept_z_create_time,
  dept.update_by       as dept_z_update_by,
  dept.update_time     as dept_z_update_time
FROM sys_user
  LEFT JOIN
  sys_dept

dept是 红色的

[2020-08-13 10:07:58] [42000][905] ORA-00905: 缺失关键字
[2020-08-13 10:07:58] java.lang.RuntimeException: Error : 905, Position : 1284, Sql = SELECT
[2020-08-13 10:07:58] sys_user.id          as id,
[2020-08-13 10:07:58] sys_user.dept_id     as dept_id,
[2020-08-13 10:07:58] sys_user.login_name  as login_name,
[2020-08-13 10:07:58] sys_user.user_name   as user_name,
[2020-08-13 10:07:58] sys_user.password    as password,
[2020-08-13 10:07:58] sys_user.salt        as salt,
[2020-08-13 10:07:58] sys_user.email       as email,
[2020-08-13 10:07:58] sys_user.phonenumber as phonenumber,
[2020-08-13 10:07:58] sys_user.gender      as gender,
[2020-08-13 10:07:58] sys_user.avatar      as avatar,
[2020-08-13 10:07:58] sys_user.status      as status,
[2020-08-13 10:07:58] sys_user.del_flag    as del_flag,
[2020-08-13 10:07:58] sys_user.login_ip    as login_ip,
[2020-08-13 10:07:58] sys_user.login_date  as login_date,
[2020-08-13 10:07:58] sys_user.create_by   as create_by,
[2020-08-13 10:07:58] sys_user.create_time as create_time,
[2020-08-13 10:07:58] sys_user.update_by   as update_by,
[2020-08-13 10:07:58] sys_user.update_time as update_time,
[2020-08-13 10:07:58] dept.id              as dept_z_id,
[2020-08-13 10:07:58] dept.parent_id       as dept_z_parent_id,
[2020-08-13 10:07:58] dept.ancestors       as dept_z_ancestors,
[2020-08-13 10:07:58] dept.dept_name       as dept_z_dept_name,
[2020-08-13 10:07:58] dept.order_num       as dept_z_order_num,
[2020-08-13 10:07:58] dept.leader          as dept_z_leader,
[2020-08-13 10:07:58] dept.phone           as dept_z_phone,
[2020-08-13 10:07:58] dept.email           as dept_z_email,
[2020-08-13 10:07:58] dept.status          as dept_z_status,
[2020-08-13 10:07:58] dept.del_flag        as dept_z_del_flag,
[2020-08-13 10:07:58] dept.create_by       as dept_z_create_by,
[2020-08-13 10:07:58] dept.create_time     as dept_z_create_time,
[2020-08-13 10:07:58] dept.update_by       as dept_z_update_by,
[2020-08-13 10:07:58] dept.update_time     as dept_z_update_time
[2020-08-13 10:07:58] FROM sys_user
[2020-08-13 10:07:58] LEFT JOIN
[2020-08-13 10:07:58] sys_dept, OriginalSql = SELECT
[2020-08-13 10:07:58] sys_user.id          as id,
[2020-08-13 10:07:58] sys_user.dept_id     as dept_id,
[2020-08-13 10:07:58] sys_user.login_name  as login_name,
[2020-08-13 10:07:58] sys_user.user_name   as user_name,
[2020-08-13 10:07:58] sys_user.password    as password,
[2020-08-13 10:07:58] sys_user.salt        as salt,
[2020-08-13 10:07:58] sys_user.email       as email,
[2020-08-13 10:07:58] sys_user.phonenumber as phonenumber,
[2020-08-13 10:07:58] sys_user.gender      as gender,
[2020-08-13 10:07:58] sys_user.avatar      as avatar,
[2020-08-13 10:07:58] sys_user.status      as status,
[2020-08-13 10:07:58] sys_user.del_flag    as del_flag,
[2020-08-13 10:07:58] sys_user.login_ip    as login_ip,
[2020-08-13 10:07:58] sys_user.login_date  as login_date,
[2020-08-13 10:07:58] sys_user.create_by   as create_by,
[2020-08-13 10:07:58] sys_user.create_time as create_time,
[2020-08-13 10:07:58] sys_user.update_by   as update_by,
[2020-08-13 10:07:58] sys_user.update_time as update_time,
[2020-08-13 10:07:58] dept.id              as dept_z_id,
[2020-08-13 10:07:58] dept.parent_id       as dept_z_parent_id,
[2020-08-13 10:07:58] dept.ancestors       as dept_z_ancestors,
[2020-08-13 10:07:58] dept.dept_name       as dept_z_dept_name,
[2020-08-13 10:07:58] dept.order_num       as dept_z_order_num,
[2020-08-13 10:07:58] dept.leader          as dept_z_leader,
[2020-08-13 10:07:58] dept.phone           as dept_z_phone,
[2020-08-13 10:07:58] dept.email           as dept_z_email,
[2020-08-13 10:07:58] dept.status          as dept_z_status,
[2020-08-13 10:07:58] dept.del_flag        as dept_z_del_flag,
[2020-08-13 10:07:58] dept.create_by       as dept_z_create_by,
[2020-08-13 10:07:58] dept.create_time     as dept_z_create_time,
[2020-08-13 10:07:58] dept.update_by       as dept_z_update_by,
[2020-08-13 10:07:58] dept.update_time     as dept_z_update_time
[2020-08-13 10:07:58] FROM sys_user
[2020-08-13 10:07:58] LEFT JOIN
[2020-08-13 10:07:58] sys_dept, Error Msg = ORA-00905: 缺失关键字
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:733)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:904)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1276)
[2020-08-13 10:07:58] 	at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:366)
[2020-08-13 10:07:58] 	at com.intellij.database.remote.jdbc.impl.RemoteStatementImpl.executeQuery(RemoteStatementImpl.java:161)
[2020-08-13 10:07:58] 	at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
[2020-08-13 10:07:58] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2020-08-13 10:07:58] 	at java.lang.reflect.Method.invoke(Method.java:498)
[2020-08-13 10:07:58] 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
[2020-08-13 10:07:58] 	at sun.rmi.transport.Transport$1.run(Transport.java:200)
[2020-08-13 10:07:58] 	at sun.rmi.transport.Transport$1.run(Transport.java:197)
[2020-08-13 10:07:58] 	at java.security.AccessController.doPrivileged(Native Method)
[2020-08-13 10:07:58] 	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
[2020-08-13 10:07:58] 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
[2020-08-13 10:07:58] 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
[2020-08-13 10:07:58] 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
[2020-08-13 10:07:58] 	at java.security.AccessController.doPrivileged(Native Method)
[2020-08-13 10:07:58] 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
[2020-08-13 10:07:58] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[2020-08-13 10:07:58] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[2020-08-13 10:07:58] 	at java.lang.Thread.run(Thread.java:745) (no stack trace)

去掉as 正常执行

SELECT
  sys_user.id          as id,
  sys_user.dept_id     as dept_id,
  sys_user.login_name  as login_name,
  sys_user.user_name   as user_name,
  sys_user.password    as password,
  sys_user.salt        as salt,
  sys_user.email       as email,
  sys_user.phonenumber as phonenumber,
  sys_user.gender      as gender,
  sys_user.avatar      as avatar,
  sys_user.status      as status,
  sys_user.del_flag    as del_flag,
  sys_user.login_ip    as login_ip,
  sys_user.login_date  as login_date,
  sys_user.create_by   as create_by,
  sys_user.create_time as create_time,
  sys_user.update_by   as update_by,
  sys_user.update_time as update_time,
sys_dept.id              as dept_z_id,
sys_dept.parent_id       as dept_z_parent_id,
sys_dept.ancestors       as dept_z_ancestors,
sys_dept.dept_name       as dept_z_dept_name,
sys_dept.order_num       as dept_z_order_num,
sys_dept.leader          as dept_z_leader,
sys_dept.phone           as dept_z_phone,
sys_dept.email           as dept_z_email,
sys_dept.status          as dept_z_status,
sys_dept.del_flag        as dept_z_del_flag,
sys_dept.create_by       as dept_z_create_by,
sys_dept.create_time     as dept_z_create_time,
sys_dept.update_by       as dept_z_update_by,
sys_dept.update_time     as dept_z_update_time
FROM sys_user
  LEFT JOIN
  sys_dept ON sys_user.dept_id = sys_dept.id

去掉as 能 正常运行

SELECT
  sys_user.id          as id,
  sys_user.dept_id     as dept_id,
  sys_user.login_name  as login_name,
  sys_user.user_name   as user_name,
  sys_user.password    as password,
  sys_user.salt        as salt,
  sys_user.email       as email,
  sys_user.phonenumber as phonenumber,
  sys_user.gender      as gender,
  sys_user.avatar      as avatar,
  sys_user.status      as status,
  sys_user.del_flag    as del_flag,
  sys_user.login_ip    as login_ip,
  sys_user.login_date  as login_date,
  sys_user.create_by   as create_by,
  sys_user.create_time as create_time,
  sys_user.update_by   as update_by,
  sys_user.update_time as update_time,
  dept.id              as dept_z_id,
  dept.parent_id       as dept_z_parent_id,
  dept.ancestors       as dept_z_ancestors,
  dept.dept_name       as dept_z_dept_name,
  dept.order_num       as dept_z_order_num,
  dept.leader          as dept_z_leader,
  dept.phone           as dept_z_phone,
  dept.email           as dept_z_email,
  dept.status          as dept_z_status,
  dept.del_flag        as dept_z_del_flag,
  dept.create_by       as dept_z_create_by,
  dept.create_time     as dept_z_create_time,
  dept.update_by       as dept_z_update_by,
  dept.update_time     as dept_z_update_time
FROM sys_user
  LEFT JOIN
  sys_dept dept ON sys_user.dept_id = dept.id


添加回复
请先登陆
回到顶部