一.概要
FineReport帳票プロジェクトの管理と稼働状態の管理をより便利にするため、管理ポータルでログの記録を設定できます。
LogDBはFineReport帳票プロジェクトに関するログを保存するビルドインデータベースです。
二.LogDBデータベース紹介
1.LogDBに接続
1.[サーバ]-[データ接続定義]をクリックして、新しいJDBCデータ接続を作成します。データ接続の名称をFineDBに変更します。
2.下図のように、以下の内容を入力してください。
データベース | Others |
ドライバー(手入力) | com.fr.swift.jdbc.Driver |
URL | jdbc:swift:emb://default(windows/linux/mac通用) |
ユーザID | (入力する必要はない) |
パスワード | (入力する必要はない) |
注意: データ紛失やデータ改竄を防止するため、LogDB接続設定が終わった後、接続権限を設定することが推薦されます。
2.データテーブルを確認
データ接続が成功した後、データベースクエリを新規作成し、上記で作成したデータ接続を選択すると、ログデータベースの下にあるすべてのデータテーブルが表示されます。
3.クエリ文法実例
LogDBは一部のクエリ文法しかサポートできません。詳細は以下のように述べています。
3.1.詳細クエリ
詳細クエリ-例
select * from fine_record_execute select tname, displayName, consume from fine_record_execute |
3.2 group byクエリ
GROUP BYクエリは以下5つの集約方法をサポートできます。
SUM,COUNT,MAX,MIN,AVERAVG
集約について、集約方法を追加しなかった場合、既定はcountになります。
group byクエリ-例
select sum (consume) from fine_record_execute group by tname, displayName select consume from fine_record_execute group by tname, displayName /*上記のSQL文は select COUNT (consume) from fine_record_execute group by tname, displayName に等しい*/ select min (consume), max (consume) from fine_record_execute group by tname, displayName |
3.3 whereフィルター条件
簡単なwhereフィルター条件はサポートできます。例えば、
AND,OR,=,<>,>,>=,<,<=,in,isnull
whereフィルター条件-例
select * from fine_record_execute where consume > 10 select sum (consume) from fine_record_execute where consume > 10 and consume < 100 group by tname, displayName select consume from fine_record_execute where tname = `XXXX1.frm` select sum (consume) from fine_record_execute where tname in (`XXXXXX1.cpt`, `XXXXX2.cpt`) group by tname, displayName |
3.4.todate() タイムスタンプを普通の時間形式に転換
注意:2019-05-20以降のバージョンがこの機能をサポートできます。
todate() 関数の結果は以下のようになります。
2018-12-18 10:15:26
todate()-例
select todate( time ) from fine_record_execute select * from fine_record_execute where todate( time )< '2018-12-18 10:15:26' and todate( time )> '2018-12-17 10:15:26' |
3.5.like曖昧検索
注意:2019-05-20以降のバージョンがこの機能をサポートできます。
この機能は前後が「%」である文しかサポートできません。not likeはサポートできません。
ワイルドカード文字 ‘_’はサポートできません。
like曖昧検索-例
select * from fine_record_execute where tname like '%demo%' |