
Java
ray_yang0420
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
class.getResource()与ClassLoader.getResource()中的参数需要怎么填写
Class.getResource(String name):在当前调用类的同一路径下查找该资源例如,我的当前类在impl包下面,那么Class.getResource()就定位于路径:/D:/learnSpringboot/basicJava/out/production/basicJava/impl/1.如果查询的资源与当前类路径相同,都在impl包下相对路径的写法Class.getResource("Xxx.xxx")绝对路径的写法Class.getResource(”/impl/..原创 2021-01-07 20:54:08 · 397 阅读 · 0 评论 -
Access denied for user ‘‘@‘localhost‘ (using password: NO)
发现错误的时候,我还以为登录mysql的密码不对,结果发现springboot的自动补全坑了我我的数据库配置如下:spring.datasource.driver-class-name=com.mysql.jdbc.Driver#数据的URLspring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC#登录数据库的原创 2020-12-10 16:52:44 · 1077 阅读 · 0 评论 -
Java collection的Iterator的使用
看到了Java核心技术一书的集合的迭代器,写篇文章记录一下interface Iterator<E>,有四个方法:hasNext(),next(),remove(),forEachRemaining(),最后一个方法是JDK1.8新增的接下来使用迭代器中的方法遍历一个collection1.传统方式,使用hasNext(),next() public static void main(String[] args) { Collection<String&原创 2020-12-08 15:02:11 · 321 阅读 · 0 评论 -
连接MySQL数据库报错The server time zone value ‘�й���ʱ��‘ is unrecognized or represemore than one time zone
连接MySQL报了一个时区的错误:The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you原创 2020-11-28 15:27:31 · 412 阅读 · 0 评论 -
将jar包导入本地仓库,然后在maven项目中添加依赖
今天在windows环境下需要集成海康威视的SDK,项目需要依赖两个jar包1.我的jar放在这个文件夹下面2.打开window命令窗口,进入到这个文件夹所在的目录3.输入 mvn install:install-file -DgroupId=com.hcsdk -DartifactId=face-jna -Dversion=1.0.0 -Dpackaging=jar -Dfile=jna.jarDfile:是我要转成的maven依赖的jar包,这是有一个相对的路径,所以先切换到..原创 2020-11-22 10:12:14 · 1462 阅读 · 0 评论 -
maven命令打包失败Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile
在idea的Terminal窗口执行命令mvn clean package -Dmaven.test.skip=true出现如下错误:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project basic: Fatal error compiling: 无效的目标发现版:1.8 -> [Help 1]原因是maven.原创 2020-11-04 10:34:37 · 3551 阅读 · 0 评论 -
遍历list同时删除不需要的元素
在遍历list的时候想要删除其中某些元素,可以使用如下方法1.倒序遍历listList<String> list=new ArrayList<>();list.add("1");list.add("2");list.add("3");list.add("4");int size = list.size();for(int i=size-1;i>=0;i--){ if(list.get(i).equals("3")) list.remove(原创 2020-08-19 14:05:30 · 310 阅读 · 0 评论 -
海康威视人脸门禁对接开发(一)调用设备篇
上一篇的准备工作做好后,给设备通上网,需要在设备上面配置1.注册设备,设备会返回:唯一用户ID,lUserID/** * 海康人脸识别机器型号:DS-K1T610M-KSC,DS-K1Y607M */ public static void main(String[] args) { HCNetDeviceUtil hcNetDeviceUtil=new HCNetDevi...原创 2020-01-22 10:28:26 · 19321 阅读 · 38 评论 -
海康威视人脸门禁对接开发(一)准备篇
前一段时间在HR系统中做了一个人脸识别考勤的模块,主要功能:设备注册,下发卡号与人脸,获取卡号与人脸,删除卡号与人脸,对设备布防,报警回调函数。首先在Window上开发,我们项目的JDK是1.6(64位),所以必须要用Win64的SDK开发包,这个很重要,版本对不上,在调用HCNetSDK.dll这个库文件时会报错,现在开始开发。1.先去海康官网下载最新的SDK 官网地址:https://...原创 2020-01-22 09:58:36 · 27459 阅读 · 48 评论 -
对List进行排序
项目中经常需要对list排序,第一中是在数据库中排序,第二种就是使用编程语言来排序,记录下我知道的Java中对list的排序方法1.JDK1.7版本1.如果对List<Integer>这中包装类型list进行排序 ,已经实现Comparable接口并重写compareTo方法(源码中可以看到)Collections.sort(list);2.对List<实...原创 2020-01-14 16:13:39 · 1205 阅读 · 1 评论