- 博客(73)
- 资源 (1)
- 收藏
- 关注
原创 TestDatagramChannel
public class TestDatagramChannel { @Test public void send()throws Exception{ DatagramChannel datagramChannel = DatagramChannel.open(); datagramChannel.configureBlocking(false); ByteBuffer buffer = ByteBuffer.allocate(1024).
2021-12-21 14:31:20
162
原创 TestPipe
public class TestPipe { @Test public void test()throws Exception{ Pipe pipe = Pipe.open(); final Pipe.SinkChannel sinkChannel = pipe.sink(); final Pipe.SourceChannel sourceChannel = pipe.source(); Thread t1 = new .
2021-12-21 14:29:26
274
原创 quartz定时任务配置
<?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:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework..
2021-06-12 10:28:37
1344
原创 Oracle改字段
alter table DAT_DEV enable row movement;update DAT_DEV SET ..........;alter table DAT_DEV disable row movement;
2021-06-10 17:10:28
99
原创 Oracle的序列使用
<selectKey resultType="java.lang.Long" keyProperty="datFaultId" order="BEFORE"> select SEQ_DAT_FAULT.nextval from dual</selectKey>insert into DAT_FAULT (DAT_FAULT_ID) values (#{datFaultId})
2021-06-10 10:33:44
90
原创 地址树遍历
@RequestMapping(value = "/selectPatrolAddressTree", method = {RequestMethod.GET, RequestMethod.POST}) @ResponseBody public String selectPatrolAddressTree(HttpServletRequest request, HttpServletResponse response) { JSONObject json = new JSO.
2021-05-26 17:26:49
223
原创 非阻塞式NIO
@Test public void client() throws IOException { SocketChannel socketChannel = SocketChannel.open(new InetSocketAddress("127.0.0.1", 9896)); socketChannel.configureBlocking(false); ByteBuffer buffer = ByteBuffer.allocate(1024); buffer.put((n.
2021-04-05 14:11:55
113
原创 NIO阻塞式传输数据
@Test public void client() throws IOException { SocketChannel socketChannel = SocketChannel.open(new InetSocketAddress("127.0.0.1", 9897)); FileChannel fileChannel = FileChannel.open(Paths.get("D:\\1.png"), StandardOpenOption.READ); ByteBuffer buff.
2021-04-03 14:49:43
97
原创 NIO读写文件例子
/** * 分散读取与聚集写入 * @throws Exception */ @Test public void test4() throws Exception { RandomAccessFile file = new RandomAccessFile("D:\\2.txt", "rw"); FileChannel channel1 = file.getChannel(); ByteBuffer buff1 = ByteBuffer.allocate(20); .
2021-04-02 15:17:29
158
原创 数据库排名次函数
下面介绍三种用于进行排序的专用窗口函数:1、RANK() 在计算排序时,若存在相同位次,会跳过之后的位次。 例如,有3条排在第1位时,排序为:1,1,1,4······2、DENSE_RANK() 这就是题目中所用到的函数,在计算排序时,若存在相同位次,不会跳过之后的位次。 例如,有3条排在第1位时,排序为:1,1,1,2······3、ROW_NUMBER() 这个函数赋予唯一的连续位次。 例如,有3条排在第1位时,排序为:1,2,3,4···.
2021-03-06 16:13:22
897
原创 饼状图通过controller输出到jsp页面
@RequestMapping("imgSecond") public void genImageChart(HttpServletResponse resp) { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("A1", new Double(20)); dataset.setValue("B1", new Double(20)); dataset.setValue("C1", new Dou.
2021-02-27 15:27:44
147
原创 ContextLoaderListener导致quartz重复而报错
添加了监听org.springframework.web.context.ContextLoaderListener,导致quartz任务报错:Unable to store Job : 'FH_JOBGROUP_NAME.job1', because one already exists with this identification.原因是ContextLoaderListener 和 DispatcherServlet 对应用上下文重复加载,applicationContext.xml被实例化2
2021-02-11 10:19:23
890
1
原创 SSM框架里使用quartz调用service
QuartzServletContextListener 代码如下(用于监听quartz,生成ServletContext):public class QuartzServletContextListener extends QuartzInitializerListener { public static final String MY_CONTEXT_NAME = "servletContext"; @Override public void contextDestroyed(Se
2021-02-10 10:15:18
387
1
原创 Linux常用命令
systemctl stop nginxsystemctl start nginxchmod -R 777 ./nginx.confbash -f ./startup.sh -p 3333ps -ef|grep nacos|grep -v grep |wc -l #查看进程数sudo apt-get install nginx #Ubuntu在线安装Nginxls -ltr #按时间排序显示...
2020-11-27 18:33:05
123
原创 存储过程创建下个月每天表的小例子
delimiter $$CREATE PROCEDURE sp_create_table()BEGIN DECLARE next_year int; DECLARE next_month int; DECLARE next_day int; DECLARE next_month_str VARCHAR(2); DECLARE next_day_str VARCHAR(2); DECLARE table_name_str VARCHAR(20); DECLARE t.
2020-10-02 13:41:29
197
原创 jstl 判断一个字符串是否包含另一个字符串
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %><c:set.
2020-08-06 17:22:22
1501
原创 struts2例子
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"><struts> <!--设置用户界面主题,默认值为XHTML风格 --> <consta.
2020-08-04 10:55:26
136
原创 sql查询等于什么的一条数据或者查询所有
select * from t_table where ( id=? or ?=0 )?为参数,如果id=?就是查询一个,如果参数=0,就是查询所有
2020-06-09 14:35:27
1432
原创 读取图片并显示在JSP页面上
@RequestMapping("img") public void genImage(HttpServletResponse resp) throws Exception { try { InputStream is = new FileInputStream(new File("e:/PieChart2.png")); OutputStream os = new BufferedOutputStream(resp.getOutputStream()); byte[] bu.
2020-05-17 16:14:51
1326
原创 饼装图的生成
package cn.bdqn.test;import java.awt.Color;import java.awt.image.BufferedImage;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;.
2020-05-17 15:31:07
303
原创 WebSocket小例子
package cn.bdqn.websocket;import java.util.HashMap;import java.util.Map;import javax.websocket.OnClose;import javax.websocket.OnError;import javax.websocket.OnMessage;import javax.websocket.O...
2020-04-06 09:10:32
158
原创 PHP7加载MySQL
1、修改php.ini文件,将extension=pdo_mysql前面的分号去掉,将extension_dir =“ext”这里的地址填写完整, 如extension_dir = “C:\Program Files\PHP\ext”。最后重启httpd。2、新版的需要使用PDO或者mysqli连接。测试:&l...
2020-03-24 15:49:39
802
原创 httpd加载PHP
#加载PHP7LoadModule php7_module 'd:/server/php7/php7apache2_4.dll'AddType application/x-httpd-php .phpPHPIniDir 'd:/server/php7'在httpd的配置文件里加上上面的配置
2020-03-18 11:17:04
350
1
原创 安装压缩包版httpd
主要的配置步骤:1.配置DocumentRoot为安装路径下的htdocsDocumentRoot "D:/server/apache/htdocs"2.配置ServerName为localhost,其中端口可以省略,在Listen里面配置ServerName localhost3.修改C:\Windows\System32\drivers\etc该路径下的hosts文件,增...
2020-03-14 16:49:55
222
原创 定时任务
package com.zwkj.test;import java.text.DateFormat;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;import java.util.Timer;import java.util.TimerTask;pu...
2019-11-04 13:49:04
114
原创 页面刷新的方法
Javascript刷新页面的几种方法:1 history.go(0)2 location.reload()3 location=location4 location.assign(location)5 document.execCommand('Refresh')6 window.navigate(location)7 location.replace(location)8 d...
2019-10-24 15:08:51
174
原创 mybatis有多个参数,并要判断是否为空
当mybatis有多个参数时,mapper.java文件即dao层必须写上@Param注解List<AddressBean> listAddressByDate(@Param("startDate")String startDate, @Param("endDate")String endDate);然后在xml文件里用where if判断是否为空,注意if的test判断里不...
2019-10-23 16:15:56
4128
原创 SQL查询字段值相同的数据
select col,count(*)from talbegroup by colhaving count(*)>1
2019-10-23 08:33:29
3630
原创 ORACLE分页查询SQL语句
SELECT * FROM ( SELECT A.*, rownum r FROM ( SELECT * FROM t_placecommon ) A WHERE rownum <= 10) B WHERE r >1
2019-10-22 10:05:10
221
原创 去掉开头的0
String str = "02"; String newStr = str.replaceFirst("^0*", ""); System.out.println(newStr);
2019-10-21 11:58:22
334
原创 保存http的文件到本地
List<BasicNameValuePair> list = new ArrayList<BasicNameValuePair>();list.add(new BasicNameValuePair("jsonStr", JSON.toJSONString(myMap)));String params = EntityUtils.toString(new UrlEnc...
2019-10-21 09:10:56
584
原创 阿拉伯数字转中文数字
package cn.zwkj.utils;public class MyUtils { public static void main(String[] args) { String str = "2019"; // 将字符串数字转化为汉字 toChinese(str); } private st...
2019-10-18 09:26:57
141
原创 javaBean设置时间属性的格式
@DateTimeFormat(pattern="yyyy-MM-dd")private Date DENGJISHIJIAN;
2019-10-17 15:41:48
1678
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人