Skip to content

Instantly share code, notes, and snippets.

View junjiantech's full-sized avatar

Junjian junjiantech

  • China,ShanDong
View GitHub Profile
@junjiantech
junjiantech / linux_java_druid_connect_oracle_SQLRecoverableException_Connection-reset.sh
Created December 16, 2020 03:31
Linux 下 JAVA + Druid 连接 ORACLE 出现 SQLRecoverableException Exception: Connection reset
# 启动时使用 -Djava.security.egd=file:/dev/urandom 修复该问题
nohup java -Djava.security.egd=file:/dev/urandom -jar $runjarfile >lc-pet.log &
@junjiantech
junjiantech / query_closest_person_by_latitude_longitude.sql
Created December 16, 2020 01:26
根据经纬度从数据库查询出距离你最近的人
--- $lng 为待查询的经度 $lat 为待查询的纬度
SELECT *
FROM (
SELECT T_POI.*
, POWER(MOD(ABS(T_POI.LNG - $lng), 360), 2) + POWER(ABS(T_POI.LAT - $lat), 2) AS distance
FROM T_POI
ORDER BY distance ASC
)
WHERE ROWNUM <= 10;