めも

技術メモとその他

2021-01-01から1年間の記事一覧

【BIRT】日付情報がサーバ情報を反映しない場合

bugs.eclipse.org ロケールを明示します

【BIRT】Birtレポートからレポートパラメータを抽出するjavaサンプル

package birtAnalizer; import java.io.File; import java.io.IOException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.Attributes; imp…

【Postgresql】 テーブル全体を固定長データとして出力するサンプル

サンプルテーブルの構造は以下の通り select * from nyukintable; id | siten | kokyakuid | nyukin | torihikibi ----+-------+-----------+--------+------------ 1 | 東京 | 001 | 77500 | 2007-01-01 2 | 大阪 | 002 | 56200 | 2007-01-02 3 | 福岡 | 00…

【Postgresql】 重複排除と先頭取得の併用(distinct on & lead)

サンプルテーブルの構造です ch_dateはレート(rate)の変更を行った日付ですが、 レートの適用期間を算出したい(yyyy-mm-dd〜yyyy-mm-dd 0.001%) a=# select * from rate_history order by ch_date; ch_date | rate ---------------------+----------- 2021-0…

【Postgresql】集計して、CSV形式にする方法

select * from nyukintable; id | siten | kokyakuid | nyukin | torihikibi ----+-------+-----------+--------+------------ 1 | 東京 | 001 | 77500 | 2007-01-01 2 | 大阪 | 002 | 56200 | 2007-01-02 3 | 福岡 | 003 | 17900 | 2007-01-03 4 | 東京 | 0…

【Postgresql】総合計を計算する

テーブルの構造とデータの状態です select * from bs_summary ; agg_code | debit | credit ----------+---------+-------- 1002 | 1000000 | 1001 | 1000000 | 2001 | | 800000 2002 | | 800000 (4 rows) 各列の合計を最後に出力する select coalesce(agg_c…

memo util

Spring で DI しつつ Theories ランナーを使いたい - Qiita

【Junit】excelのデータを読みつつJunitテストを実行する

package viewda; import java.io.File; import java.io.IOException; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.apache.poi.EncryptedDocumentException; import org.…

【Junit】アノテーションを用いたテストサンプル

package viewda; import static org.junit.Assert.*; import org.junit.experimental.theories.DataPoint; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; @RunWith(T…

javaからMS-Excelを読むサンプルコード

import java.io.FileInputStream; import java.util.ArrayList; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apach…

【Postgresql】 generate_seriesを使ったシーケンス(日付)

select * from GENERATE_SERIES('2020-03-12'::timestamp, '2030-03-12'::timestamp, '6 month'::INTERVAL); generate_series --------------------- 2020-03-12 00:00:00 2020-09-12 00:00:00 2021-03-12 00:00:00 2021-09-12 00:00:00 2022-03-12 00:00:00…

eclipseBIRT におけるdecimal型とfloat型について

ref: bugs.eclipse.org and test below: exam

postgreSqlのスキーマ を比較する

参考にさせてもらいました hacknote.jp

thanks helps

tmftake.hateblo.jp

dbunt - apache poi export excel date type format helps me

shorindo.com

ファイル更新を感知するシェルスクリプト

参考にさせてもらいました。 指定したファイルの更新があったらコマンドを自動実行するシェルスクリプト - 午睡二時四十分

java classファイルのデコンパイル( jspc )

www.ne.jp

【Birt】動的にwhere句をデータセットクエリに追加する

1. query 2. dynamic where clause(if parameter in)

【Postgresql】件数を元に連番を生成する generate_series

luna=# select * from sample; stake_no | cnt ----------+----- 0001 | 1 0002 | 3 (2 rows) luna=# select * from sample,generate_series(1, 99) as id where sample.cnt >= id; stake_no | cnt | id ----------+-----+---- 0001 | 1 | 1 0002 | 3 | 1 00…

【Java】easy mock "入れ子"のサンプル

<test class> 1. inner class public class ConcatorIml implements Concater { @Override public String concat(String str1, String str2) throws Exception { String conc = ""; conc = str1+str2; return conc; } } 2.outer class public class parConcatorImpl impl</test>…