Skip to content

Instantly share code, notes, and snippets.

View donchan922's full-sized avatar
🐶
I'm fine.

donchan922 donchan922

🐶
I'm fine.
View GitHub Profile
001,Alice,2020/01/01 00:00:00
002,Bob,2020/01/02 01:23:45
003,Carol,2020/01/03 10:20:30
$ sqlplus ユーザ名/パスワード@接続文字列 @demo.sql
alter session set nls_date_format="YYYY/MM/DD HH24:MI:SS";
set echo off
set termout off
set pagesize 0
set linesize 1000
set trims on
set feedback off
spool output.csv
SELECT
id ||','||
boolean isDeleted = FileSystemUtils.deleteRecursively(new File("/path/to/directory"));
- Java 11
FileUtils.deleteDirectory(new File("/path/to/directory"));
// ログイン処理
...
// 転送するファイル種別をバイナリに設定する
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
// ファイル転送処理
...
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="CheckStyle-IDEA-Module">
<option name="configuration">
<map />
</option>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
try {
Response response = restTemplate.getForObject("http://localhost:8080/error", Response.class);
} catch(RestClientResponseException exception) {
exception.getRawStatusCode(); // HTTPステータスコード
exception.getResponseHeaders(); // レスポンスヘッダ
exception.getResponseBodyAsString(); // レスポンスボディ
}
RestClientException (RestTemplateが投げる例外のベースとなるクラス)
├── RestClientResponseException (HTTPレスポンスデータを含む例外のベースとなるクラス)
│   ├── HttpStatusCodeException (ステータスコードに基づく例外の抽象クラス)
│ │ ├── HttpClientErrorException (4xx系のステータスコードを受信したとき)
│   │ └── HttpServerErrorException (5xx系のステータスコードを受信したとき)
│ └── UnknownHttpStatusCodeException (不明なステータスコードを受信したとき)
└── ResourceAccessException (I/Oエラーが発生したとき)