mysql 异常处理 CONTINUE HANDLER FOR SQLEXCEPTION 5C

一个存储过程,循环表数据,遇到异常回滚,如果插入发生错误,删除还能正常执行,不能回滚
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION 不能回滚吗
DELIMITER $$

DROP PROCEDURE IF EXISTS test$$

CREATE DEFINER=ydkj@% PROCEDURE test()
BEGIN
DECLARE done INT ;
DECLARE order_id BIGINT ;
DECLARE order_cursor CURSOR FOR
SELECT
id
FROM
order_info a
WHERE a.DEL_FLAG = '1'
OR a.STATUS = '99' ;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1 ;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
COMMIT ;
END ;
OPEN order_cursor ;
-- 循环
order_loop :
LOOP
-- 取游标中的数据
FETCH order_cursor INTO order_id ;
IF done = 1
THEN LEAVE order_loop ;
END IF ;

START TRANSACTION ;

INSERT INTO _order SELECT NOW(),a.* FROM order_ext a WHERE a.order_id = order_id ;
 DELETE FROM t_cargo_order_info WHERE id = cargo_order_id ;

COMMIT;
END LOOP ;
CLOSE order_cursor ;
END$$

DELIMITER ;

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
mysql存储过程添加异常处理?为什么报错?麻烦指点一下 谢谢!

![图片说明](https://img-ask.csdn.net/upload/201812/19/1545203860_118320.png) create PROCEDURE test() BEGIN DECLARE p_sqlcode VARCHAR(50) ; DECLARE p_sqlcode2 VARCHAR(50) ; DECLARE p_status_message VARCHAR(50) ; DECLARE duplicate_key CONDITION FOR 1062 ; declare v_etl_dt date; set v_etl_dt=sysdate(); DECLARE CONTINUE HANDLER FOR duplicate_key BEGIN SET p_sqlcode=1062; set p_sqlcode2='3'; SET p_status_message='Duplicate key error'; END; insert into departments values ('公寓1','11','北京',v_etl_dt); select p_sqlcode2,p_sqlcode,p_status_message from dual; end;

Vue点击事件无效:Invalid handler for event "click": got undefined

描述: 定义了单击事件,但是使用Vue组件生成的标签就检测不到单击的方法,并报错:Invalid handler for event "click": got undefined 把标签放到外面可以正常使用,使用Vue组件生成后就报错,而且msg这个也找不到了 请问该如何处理?以下是全部代码 ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>index</title> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/vue.js"></script> </head> <body> <div id="container"> <div id="navbar_left"> <pr></pr> </div> </div> <script> Vue.component("pr",{ name:"pr", template:"<p @click='this.toggle'>{{msg}}</p>", data(){ return{ open:true } } }); var app = new Vue({ el:"#navbar_left", data:{ msg:"hello world", }, methods:{ toggle(){ this.open = !this.open } }, }); </script> </body> </html> ```

Spring异常 No adapter for handler求怎么解决

``` 重大: Servlet.service() for servlet [SpringMVC] in context with path [/GooMapController] threw exception [No adapter for handler [jp.co.nttdata.goomap.controller.GooMapController@655709bd]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler] with root cause javax.servlet.ServletException: No adapter for handler [jp.co.nttdata.goomap.controller.GooMapController@655709bd]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler at org.springframework.web.servlet.DispatcherServlet.getHandlerAdapter(DispatcherServlet.java:1163) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) ```

关于oracle的continue

在不支持continue的oracle版本(11G之前),怎么实现continue功能呢?求大神解惑。

mysql语法问题,求教!

在命令行中输入 dilimiter // create procedure demo() begin declare continue handler for sqlstate "23000" set @x2=1; 然后按下enter健,命令提示符提示错误error 1064,at line 1; 为什么?

java中mysql的异常 ,求助

异常如下: 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 'sum(money,time,nature)value(50000.0,'2019-11-08 15:15:46','购买车位')' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1912) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2133) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2067) at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5175) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2052) at shujuku.insert_money.<init>(insert_money.java:26) at car_people.pe_add$1.actionPerformed(pe_add.java:182) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) 源代码: package shujuku; import java.sql.*; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class insert_money { String sq5 = "insert into sum(money,time,nature)"+"value(?,?,?)"; Calendar calendar = Calendar.getInstance(); long int_time_js = calendar.getTimeInMillis(); Date aaaaa = calendar.getTime(); SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String in_time, xingzi; double mm; public insert_money(double money,String sss) { Connection conn = new shujuku().getConnection(); mm = money; xingzi = sss; in_time = sdf3.format(aaaaa); try { PreparedStatement ps = conn.prepareStatement(sq5); ps.setDouble(1,mm); ps.setString(2,in_time); ps.setString(3,xingzi); ps.executeUpdate(); ps.close(); }catch (Exception e1) { e1.printStackTrace(); }finally{ // 关闭数据库连接 shujuku.closeConnection(conn); } } }

springboot项目出现Did not find handler method for

项目启动成功,然后通过restclient去调用 http://127.0.0.1:8080/tiananServer/product/getProduct?id=1 时 后台日志: 7:00:18.511 [http-nio-8080-exec-1] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping -Looking up handler method for path /product/getProduct 2017-02-22 17:00:18.514 [http-nio-8080-exec-1] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping -Did not find handler method for [/product/getProduct] 2017-02-22 17:00:18.515 [http-nio-8080-exec-1] DEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping -Matching patterns for request [/product/getProduct] are [/**] 2017-02-22 17:00:18.516 [http-nio-8080-exec-1] DEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping -URI Template variables for request [/product/getProduct] are {} 2017-02-22 17:00:18.517 [http-nio-8080-exec-1] DEBUG o.s.web.servlet.handler.SimpleUrlHandlerMapping -Mapping [/product/getProduct] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@b52b755]]] and 1 interceptor 2017-02-22 17:00:18.518 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -Last-Modified value for [/tiananServer/product/getProduct] is: -1 2017-02-22 17:00:18.519 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling 2017-02-22 17:00:18.520 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -Successfully completed request 2017-02-22 17:00:18.527 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -DispatcherServlet with name 'dispatcherServlet' processing GET request for [/tiananServer/error] 2017-02-22 17:00:18.527 [http-nio-8080-exec-1] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping -Looking up handler method for path /error 2017-02-22 17:00:18.530 [http-nio-8080-exec-1] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping -Returning handler method [public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)] 2017-02-22 17:00:18.530 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -Last-Modified value for [/tiananServer/error] is: -1 2017-02-22 17:00:18.652 [http-nio-8080-exec-1] DEBUG o.s.w.s.m.m.annotation.HttpEntityMethodProcessor -Written [{timestamp=Wed Feb 22 17:00:18 CST 2017, status=404, error=Not Found, message=No message available, path=/tiananServer/product/getProduct}] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@5c8fc861] 2017-02-22 17:00:18.653 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling 2017-02-22 17:00:18.653 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet -Successfully completed request 代码片段: @Controller @RequestMapping("/product") public class ProductController { @Autowired private ProductService productService; @RequestMapping(value = "/getProduct", method = RequestMethod.GET) @ResponseBody public String getProduct(Integer id) { Product product = productService.findById(id.toString()); String jsonObject = JSONObject.toJSONString(product); return jsonObject; } } ######################################## @Configuration @ComponentScan(basePackages = { "com.tianan.controller" }) public class TokenCheckConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { // 拦截API请求 registry.addInterceptor(new TokenCheckInterceptor()).addPathPatterns("/**"); super.addInterceptors(registry); } } ###################################################### @Component public class SimpleCORSFilter implements Filter { public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletResponse response = (HttpServletResponse) res; response.setHeader("Access-Control-Allow-Origin", "*");// 来允许任何站点对该资源进行跨域请求 response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Allow-Headers", "x-requested-with"); chain.doFilter(req, res); } public void init(FilterConfig filterConfig) { } public void destroy() { } } ################################################## @SpringBootApplication @EnableAsync @Import({ DynamicDataSourceRegister.class }) // 注册动态多数据源 @PropertySource(value = "classpath:datasource.properties") public class BootApiApplication extends SpringBootServletInitializer { private static Logger logger = Logger.getLogger(BootApiApplication.class); @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(BootApiApplication.class); } public static void main(String[] args) throws Exception { SpringApplication.run(BootApiApplication.class, args); logger.info("SpringBoot Start Success"); } } ######################################### 需全部代码可联系本人,麻烦大侠帮忙看看下如何解决。

mysql1241什么问题???

BEGIN DECLARE k INT ; DECLARE m INT ; DECLARE n FLOAT ; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION,NOT FOUND,SQLWARNING SET flag=500; SET @str1='UPDATE excel SET ard = CONCAT(`ard`,",1") WHERE `name` IN '; SET @str1=CONCAT(@str1,snames); PREPARE stmt1 FROM @str1; EXECUTE stmt1; DEALLOCATE PREPARE stmt1; SET @str2='UPDATE excel SET ard = CONCAT(`ard`,",0") WHERE `name` NOT IN '; SET @str2=CONCAT(@str2,snames); PREPARE stmt2 FROM @str2; EXECUTE stmt2; DEALLOCATE PREPARE stmt2; UPDATE excel SET dates=CONCAT(dates,',',`datess`); SELECT LENGTH(excel.`ard`)-LENGTH(REPLACE(excel.`ard`,'1','')) INTO k FROM excel ; SELECT LENGTH(excel.`ard`)-LENGTH(REPLACE(excel.`ard`,',','')) INTO m FROM excel ; SET n=CONCAT(ROUND(m/(k+1) * 100, 2),'','%') ; UPDATE excel SET ardrate=n; IF flag=500 THEN ROLLBACK; ELSE SET flag=200; END IF; END$$

mysql执行存储过程时自动停止

DELIMITER $$ DROP PROCEDURE IF EXISTS generatorDataCopy $$ CREATE PROCEDURE generatorDataCopy(inpid VARCHAR(50),OUT msg VARCHAR(50)) BEGIN DECLARE err INT DEFAULT 0; -- 如果出现sql异常,则将err设置为1后继续执行后面的操作 DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET err=1; -- 出错处理 SET autocommit = 0; START TRANSACTION; INSERT INTO tbl_outhosroom_sendchdom(SCID,PLID,MEID,ECIPUCODE,OUTUCODE,AMOUNT,CURRENTINHOSMARK,DOSE,DOSEUNIT,ECIPEOPERATEDATE,PAYMONEY,UNITPRICE,OUTTIME) SELECT DISTINCT rec.SCID,rec.PLID,rec.MEID,rec.ECIPUCODE,rec.OUTUCODE,rec.AMOUNT,rec.CURRENTINHOSMARK,rec.DOSE,rec.DOSEUNIT,rec.ECIPEOPERATEDATE,rec.PAYMONEY,rec.UNITPRICE,rec.OUTTIME FROM tbl_room_sendchdom rec LEFT JOIN tbl_inhos_medord_exec exec ON rec.meid = exec.meid LEFT JOIN tbl_inhos_medord med ON exec.medordid = med.medordid WHERE med.pid=inpid; INSERT INTO tbl_outhosroom_recedechdom(RCID,SCID,MEID,PLID,UCODE,OPERUCODE,AMOUNT,CURRENTINHOSMARK,DOSE,DOSEUNIT,PAYMONEY,UNITPRICE,OUTTIME) SELECT DISTINCT rec.RCID,rec.SCID,rec.MEID,rec.PLID,rec.UCODE,rec.OPERUCODE,rec.AMOUNT,rec.CURRENTINHOSMARK,rec.DOSE,rec.DOSEUNIT,rec.PAYMONEY,rec.UNITPRICE,rec.OUTTIME FROM tbl_room_recedechdom rec LEFT JOIN tbl_room_sendchdom send ON rec.scid = send.scid LEFT JOIN tbl_inhos_medord_exec exec ON send.meid = exec.meid LEFT JOIN tbl_inhos_medord med ON exec.medordid = med.medordid WHERE med.pid=inpid; 下面是若干条insert语句...... DELETE rec FROM tbl_inhos_refund_record rec LEFT JOIN tbl_inhos_medord_exec exec ON rec.meid = exec.meid LEFT JOIN tbl_inhos_medord med ON exec.medordid = med.medordid WHERE med.pid=inpid; DELETE melist FROM tbl_inhos_medord_list melist LEFT JOIN tbl_inhos_medord med ON melist.medordid = med.medordid WHERE med.pid=inpid; 下面是若干条delete语句...... IF err=1 THEN ROLLBACK; SET msg = 'fail'; ELSE COMMIT; SET msg = 'succ'; END IF; END$$ DELIMITER ; 这是一个数据搬移的存储过程,因为涉及的表比较多,每个人的数据只能通过人的主键去关联的搬移相应的数据。有些表的数据量比较大,所以在连连续搬移的时候就会出现错误码:2013这个错误。我想问的是需要调整那些参数能解决这个问题啊?

ssm项目中ajax请求后台一部分函数后台Did not find handler method for [xxx],还有部分成功的为什么?

ssm项目中,用ajax请求后台数据,同一个controller中,同一个jsp页面,有几个function中的ajax请求成功,有的请求失败,后台的日志中是Did not find handler method for [/xxx.controller]

MYSQL 多重判断 NULL 的问题

BEGIN DECLARE done INT DEFAULT 0; DECLARE scoreNumber INT DEFAULT 0; DECLARE DefstudentId INT DEFAULT 0; DECLARE backupScrore double DEFAULT 0; DECLARE cur1 CURSOR FOR select sum(scoreNum) as sumNum,passivityId as studentId from Score group by passivityId ; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; UPDATE student d set d.badge = null; OPEN cur1; REPEAT FETCH cur1 into scoreNumber,DefstudentId; IF done = 0 THEN SELECT score INTO backupScrore from `backup` WHERE studentId = DefstudentId ORDER BY backupdate desc ,backupId DESC LIMIT 1; IF backupScrore is not NULL THEN UPDATE student d set d.growScore= scoreNumber- backupScrore where d.studentId= DefstudentId; END IF; END IF; UNTIL done = 1 END REPEAT; CLOSE cur1; END 本来是想判断 游标 值为空的时候跳出循环 DECLARE cur1 CURSOR FOR select sum(scoreNum) as sumNum,passivityId as studentId from Score group by passivityId ; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; 结果在中间 因为 这一句 IF backupScrore is not NULL THEN UPDATE student d set d.growScore= scoreNumber- backupScrore where d.studentId= DefstudentId; END IF; 就因为 backupScrore 为空就跳出了循环 该怎么改才能让这个 存储过程正确运行?

spring-security 异常处理求助

研究spring-security两个月了,只是懂了个皮毛,现在碰到了一个棘手的问题,在统一异常处理时,用Spring MVC 拦截时,会把security 抛出的异常一同拦截,这样就导致了spring-security框架不能针对自己的异常进行处理,从而不能正常和合理的进行过认证过程 于是乎加了下面这几句过滤的代码 if(ex instanceof AuthenticationException || ex instanceof AccessDeniedException){ logger.debug("spring security拋出的异常,不做处理"); return super.doResolveException(request, response, handler, ex); } 新的问题又出现了,我在框架获取用户信息的方法内加了自己的认证,出现错误时抛出自己的异常进行处理,结果被spring-security框架拦截了,而自己的异常过滤器拦截不到,达不到效果,有没有大神出现过这个问题帮我解决下

java连接mysql的时候,事务没有提交遇到错误的时候还需要回滚吗?

preparedStatement.executeUpdate(); // int i = 2 / 0; preparedStatement = connection.prepareStatement(sql2); preparedStatement.executeUpdate(); connection.commit(); java进行mysql操作的时候,事务没有提交之前遇到错误的时候还需要回滚吗?

Ambiguous handler methods mapped for HTTP

java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/aaa/knowledgeMag.do': {public com.aaa.AjaxJson com.aaa.MagControl.saveInspPro(com.aaa.InspProcessEntity,javax.servlet.http.HttpServletRequest), public com.sgcc.nrxt.autoper.sdxt.pojo.InspDictProcfun com.aaa.MagControl.procfunc(javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletRequest)} @RequestMapping(params = "procfunc") @ResponseBody public InspDictProcfun procfunc(HttpServletResponse response, ... return procfunc; } @RequestMapping(params = "saveInspPro") @ResponseBody public AjaxJson saveInspPro(InspProcessEntity inspProcess, HttpServletRequest request) { AjaxJson j = new AjaxJson(); return j; } 查了不少类似问题说是请求的方法RequestMapping参数类似造成的,问题是这两个请求参数名不类似,而且即便改了,还是这个错。 求指导!

Did not find handler method for [/index.jsp]。。。。

新手,我只是页面访问http://localhost:8080/ce2/eq/userAction/loginInit.do 能到action就是 renturn “index”提示找不到 页面404 preHandle方法名:loginInit 11:15:52.754 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.InternalResourceView: name 'index'; URL [/eq/index.jsp]] in DispatcherServlet with name 'ce' 11:15:52.755 [http-bio-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Added model object 'locale' of type [java.lang.String] to request in view with name 'index' 11:15:52.756 [http-bio-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Forwarding to resource [/eq/index.jsp] in InternalResourceView 'index' 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'ce' processing GET request for [/ce2/eq/index.jsp] 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /index.jsp 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/index.jsp] 11:15:52.762 [http-bio-8080-exec-3] WARN o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/ce2/eq/index.jsp] in DispatcherServlet with name 'ce' 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request afterCompletion方法名:loginInit 11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request 11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Closing single Hibernate Session in OpenSessionInViewFilter 11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Closing Hibernate Session **web.xml** <?xml version="1.0" encoding="UTF-8"?> <web-app id="ce" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:conf/spring.xml </param-value> </context-param> <!--<context-param> <param-name>webAppRootKey</param-name> <param-value>ce2</param-value> </context-param>--> <filter> <filter-name>encoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter> <filter-name>osivFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>osivFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>osivFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <servlet> <servlet-name>ce</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:conf/spring/ce-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ce</servlet-name> <url-pattern>/eq/*</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> **spring.xml** <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-lazy-init="true"> <context:property-placeholder location='WEB-INF/setup.properties' /> <bean id="dataSourceDruid" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="url" value="${jdbc.jdbcUrl}" /> <property name="username" value="${jdbc.user}" /> <property name="password" value="${jdbc.password}" /> <property name="initialSize" value="20" /> <property name="minIdle" value="10" /> <property name="maxActive" value="500" /> <property name="maxWait" value="3000" /> <property name="timeBetweenEvictionRunsMillis" value="60000" /> <property name="minEvictableIdleTimeMillis" value="300000" /> <property name="validationQuery" value="SELECT getdate()" /> <property name="testWhileIdle" value="true" /> <property name="testOnBorrow" value="false" /> <property name="testOnReturn" value="false" /> <property name="poolPreparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> <property name="filters" value="stat" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSourceDruid"/> </property> <property name="mappingLocations"> <list> <value>classpath*:conf/hbm/*.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="connection.autoReconnect">true</prop> <prop key="connection.autoReconnectForPools">true</prop> <prop key="connection.is-connection-validation-required">true</prop> <prop key="hibernate.dialect"> com.ce.util.SqlServer2008Dialect </prop> <prop key="hibernate.show_sql" >false</prop> <prop key="hibernate.format_sql">false</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> <prop key="hibernate.cache.use_second_level_cache">false</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.jdbc.batch_size">20</prop> </props> </property> </bean> <bean id="cacheRegionFactory" class="com.ce.hibernate.EhcacheRegionFactory"> <property name="configLocation"> <value>classpath:conf/spring/ehcache-application.xml</value> </property> <property name="diskStoreLocation"> <value>/WEB-INF/cache/application</value> </property> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref = "sessionFactory"/> </bean> <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> <import resource="classpath:conf/spring/spring-sys-conf.xml" /> </beans> **UserAction** package com.ce.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.ce.biz.UserBiz; import com.ce.entity.User; import com.ce.web.ParentsControl; /** * 用户action */ @Controller public class UserAction extends ParentsControl{ private static final Logger log = LoggerFactory.getLogger(UserAction.class); private User user; @Autowired private UserBiz userBiz; @RequestMapping(value={"userAction/loginInit.do"},method={ RequestMethod.GET}) public String loginInit(HttpServletRequest request, HttpServletResponse response){ // String root=request.getSession().getServletContext().getRealPath("/"); // request.setAttribute("ctx", root); return "index"; } }![图片说明](https://img-ask.csdn.net/upload/201607/06/1467775355_151478.png)

请教存储过程执行很慢,如何优化?

BEGIN DECLARE personPlaneId BIGINT; DECLARE starttime datetime; #开始时间 DECLARE endtime datetime; #结束时间 DECLARE sumStudyTime INT; #当前学时 DECLARE targetStudyTime INT; #目标学时 DECLARE id1_count BIGINT default 0; #t_stage_info 第一阶段count DECLARE id2_count BIGINT default 0; #t_stage_info 第二阶段count DECLARE id3_count BIGINT default 0; #t_stage_info 第三阶段count DECLARE firstEndTime datetime; #第一阶段结束时间 DECLARE secEndTime datetime; #第二阶段结束时间 DECLARE thirdEndTime datetime; #第三阶段结束时间 DECLARE done INT DEFAULT 0; #声明光标 DECLARE cur1 CURSOR FOR SELECT p1.id, p1.start_learn_time start_time, p1.last_date end_time, p1.sum_study_time,p1.target_study_time FROM t_person_plan p1 LEFT JOIN t_person_plan_record p2 ON p1.id = p2.person_plan_id WHERE p1.license_type = 7 AND p1.last_date <= CURRENT_DATE(); #t_person_plan_record p2 这个表数据大概500多万条 #当游标到达尾部时,mysql自动设置done=1 declare continue handler for SQLSTATE '02000' SET done = 1; OPEN cur1; REPEAT /* 移动游标并赋值 */ fetch cur1 into personPlaneId,startTime,endTime,sumStudyTime,targetStudyTime; if NOT done then #获取第一阶段结束时间 SET firstEndTime = (SELECT add_time FROM t_person_plan_record WHERE person_plan_id=personPlaneId AND chapter_id=29611); #获取第二阶段结束时间 SET secEndTime = (SELECT add_time FROM t_person_plan_record WHERE person_plan_id=personPlaneId AND chapter_id=29625); #获取第三阶段结束时间 SET thirdEndTime = (SELECT add_time FROM t_person_plan_record WHERE person_plan_id=personPlaneId AND chapter_id=29734); #获取主键标识 SELECT count(1) into id1_count from t_stage_info where person_plan_id=personPlaneId AND stage=1; SELECT count(1) into id2_count from t_stage_info where person_plan_id=personPlaneId AND stage=2; SELECT count(1) into id3_count from t_stage_info where person_plan_id=personPlaneId AND stage=3; IF sumStudyTime <= 12 THEN IF id1_count=0 THEN INSERT INTO t_stage_info(person_plan_id,start_time,end_time,sum_study_time,target_study_time,stage) VALUES(personPlaneId,startTime,endTime,sumStudyTime,targetStudyTime,1); ELSE UPDATE t_stage_info SET end_time=endTime,sum_study_time=sumStudyTime WHERE person_plan_id=personPlaneId AND stage=1; END IF; #当学到第二阶段时 ELSEIF sumStudyTime>12 AND sumStudyTime<=14 THEN #更新第一阶段数据 IF id1_count=0 THEN INSERT INTO t_stage_info(person_plan_id,start_time,end_time,sum_study_time,target_study_time,stage) VALUES(personPlaneId,startTime,firstEndTime,sumStudyTime,targetStudyTime,1); ELSE UPDATE t_stage_info SET end_time=firstEndTime,sum_study_time=sumStudyTime WHERE person_plan_id=personPlaneId AND stage=1; END IF; #更新第二阶段数据 IF id2_count=0 THEN INSERT INTO t_stage_info(person_plan_id,start_time,end_time,sum_study_time,target_study_time,stage) VALUES(personPlaneId,firstEndTime,endTime,sumStudyTime,targetStudyTime,2); ELSE UPDATE t_stage_info SET end_time=endTime,sum_study_time=sumStudyTime WHERE person_plan_id=personPlaneId AND stage=2; END IF; #当学到第三阶段时 ELSEIF sumStudyTime>14 THEN #如果thirdEndTime为空则取最后学习的时间 SET thirdEndTime = CASE WHEN thirdEndTime IS NULL THEN endTime ELSE thirdEndTime END; #更新第一阶段数据 IF id1_count=0 THEN INSERT INTO t_stage_info(person_plan_id,start_time,end_time,sum_study_time,target_study_time,stage) VALUES(personPlaneId,startTime,firstEndTime,sumStudyTime,targetStudyTime,1); ELSE UPDATE t_stage_info SET end_time=firstEndTime,sum_study_time=sumStudyTime WHERE person_plan_id=personPlaneId AND stage=1; END IF; #更新第二阶段数据 IF id2_count=0 THEN INSERT INTO t_stage_info(person_plan_id,start_time,end_time,sum_study_time,target_study_time,stage) VALUES(personPlaneId,firstEndTime,secEndTime,sumStudyTime,targetStudyTime,2); ELSE UPDATE t_stage_info SET end_time=secEndTime,sum_study_time=sumStudyTime WHERE person_plan_id=personPlaneId AND stage=2; END IF; #更新第三阶段数据 IF id3_count=0 THEN INSERT INTO t_stage_info(person_plan_id,start_time,end_time,sum_study_time,target_study_time,stage) VALUES(personPlaneId,secEndTime,thirdEndTime,sumStudyTime,targetStudyTime,3); ELSE UPDATE t_stage_info SET end_time=thirdEndTime,sum_study_time=sumStudyTime WHERE person_plan_id=personPlaneId AND stage=3; END IF; END IF; end if; UNTIL done END REPEAT; close cur1; END 现在执行了2小时才有了10几万数据, 我在t_person_plan_record 表里对‘person_plan_id ’建了索引, 在表t_stage_info 对person_plan_id ’建立了索引,其他我就不知道怎么优化了, 请问大神,还能怎么优化比较好呢?

#mysql mysql存储过程 表名作为变量的问题

大概意思是想要从TS_SCFZ表中的tabname字段来历遍所有表,从而查找是否有符合条件的记录 请大神帮帮忙 现在报错了 ``` drop procedure if exists deletecheck; delimiter // CREATE DEFINER = `root`@`%` PROCEDURE `deletecheck`(IN vahdm varchar(20)) BEGIN DECLARE done BOOLEAN DEFAULT FALSE; DECLARE vtable VARCHAR(24); DECLARE cur CURSOR FOR select tabname from TS_SCFZ where SFSC = 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; read_loop: LOOP FETCH cur INTO vtable; IF done THEN LEAVE read_loop; END IF; START TRANSACTION; set @sqlcmd = concat("select (1) from ",vtable," where ahdm = vahdm"); prepare stmt from @sqlcmd; IF EXISTS(execute stmt) THEN select concat('table is ',vtable); ELSE select concat(vtable,' is clean'); deallocate prepare stmt; END IF; COMMIT; END LOOP read_loop; CLOSE cur; END ``` drop procedure if exists deletecheck; delimiter // CREATE DEFINER = `root`@`%` PROCEDURE `deletecheck`(IN vahdm varchar(20)) BEGIN DECLARE done BOOLEAN DEFAULT FALSE; DECLARE vtable VARCHAR(24); DECLARE cur CURSOR FOR select tabname from TS_SCFZ where SFSC = 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; read_loop: LOOP FETCH cur INTO vtable; IF done THEN LEAVE read_loop; END IF; START TRANSACTION; set @sqlcmd = concat("select (1) from ",vtable," where ahdm = vahdm"); prepare stmt from @sqlcmd; IF EXISTS(execute stmt) THEN select concat('table is ',vtable); ELSE select concat(vtable,' is clean'); deallocate prepare stmt; END IF; COMMIT; END LOOP read_loop; CLOSE cur; END ``` [Err] 1064 - 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 'execute stmt) THEN select concat('table is ',vtable); ELSE sele' at line 16 ```

mysql 存储过程select a into b当第一次循环有记录,第二次循环没有记录时,b会赋值为上一次循环的值

``` declare v_id int; declare usrcur cursor for select name form t_app_tbl where enable=1; declare continue handler for NOT FOUND set done=1; open usrcur; usrloop :LOOP fetch usrcur into usr_name; if done=1 then leave usrloop; end if; select id into v_id from t_mer_tbl where name = usr_name; ``` loop循环多次时,当前一次循环v_id有值,下一次循环没有记录时,v_id会 赋值为上次一循环的v_id;为什么会这样,正常不是应该是null吗?

DB2函数错误SQLCODE=-390, SQLSTATE=42887

首先我自定义了一个处理日期转换的函数FUN_RE_DATE(),函数定义代码如下: CREATE OR REPLACE FUNCTION DW.FUN_RE_DATE(P_DATE VARCHAR(10)) RETURNS DATE LANGUAGE SQL BEGIN DECLARE V_DATE DATE; -- 定义错误处理 -- 如果发生错误,继续处理 -- 但是把V_DATE设置为2999-12-31 DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET V_DATE=DATE('2999-12-31'); SET V_DATE = DATE(TO_DATE(P_DATE, 'YYYYMMDD')); RETURN V_DATE; END 然后使用该函数: SELECT FDM.FUN_RE_DATE('20121212') FROM SYSIBM.DUAL 报错信息如下: DB2 SQL Error: SQLCODE=-390, SQLSTATE=42887, SQLERRMC=FDM.FUN_RE_DATE;SQL161110102436353, DRIVER=3.50.152 消息: The function "FDM.FUN_RE_DATE" resolved to specific function "SQL161110102436353" that is not valid in the context where it is used.. SQLCODE=-390, SQLSTATE=42887, DRIVER=3.50.152  请各位大神帮忙看看是什么原因!

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

ArrayList源码分析(入门篇)

ArrayList源码分析 前言: 写这篇博客的主要原因是,在我上一次参加千牵科技Java实习生面试时,有被面试官问到ArrayList为什么查找的速度较快,插入和删除的速度较慢?当时我回答得不好,很大的一部分原因是因为我没有阅读过ArrayList源码,虽然最后收到Offer了,但我拒绝了,打算寒假学得再深入些再广泛些,下学期开学后再去投递其他更好的公司。为了更加深入理解ArrayList,也为

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

玩转springboot启动banner定义所得

最近接手了一个springboot项目,不是不熟悉这个框架,启动时打印的信息吸引了我。 这不是我熟悉的常用springboot的打印信息啊,我打开自己的项目: 还真是的,不用默认的感觉也挺高大上的。一时兴起,就去研究了一下源代码,还正是有些收获,稍后我会总结一下。正常情况下做为一个老程序员,是不会对这种小儿科感兴趣的,不就是一个控制台打印嘛。哈哈! 于是出于最初的好奇,研究了项目的源代码。看到

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

立即提问
相关内容推荐