2015-08-10から1日間の記事一覧

catch 句での Throwable と Exception 違い

Throwable は JVM レベルでの Serious Error を catch する時に使う Exception より高階層な API Exception はアプリケーションレベルでの例外を catch する時に使う Throwable より低階層な API app 構築に当たるならこちらを使うべき Throwable Throwable …

try and re-throw best practice

quoted literal and source code from: IBM Best Practice: Catching and re-throwing Java Exceptions - United States re-throw is ok notice the way to re-throw Correct The correct way to catch and re-throw an exception is to pass the caught exc…

build.sbt の libraryDependencies には何を追加すればよいか

何をどのように追加すればよいか分からなかったので Maven Repository: Search/Browse/Explore に遷移 ヘッダー(?) の検索フォームにライブラリ名を入れる(ここでは postgresql とする) 結果一覧が表示されるので適当なライブラリを選択する(PostgreSQL JDBC…

JDBC Statement と PreparedStatement 使い分け

Statement 単純な実行計画を行いたい時(select * from ... を 1 回だけ など) PreparedStatement 複数回に渡る実行計画を行いたい時, ? のパラメーター解析を使いたい時(2 番目記事参照) JDBC - Statements, PreparedStatement and CallableStatementwww.tut…

connection pool

DB

基本的に、connection は開いたら閉じる 門外不出のOracle現場ワザ 第5章

static method (class method) と instance method の使い分け

Java に関わった話ではないと思い One rule-of-thumb: ask yourself "does it make sense to call this method, even if no Obj has been constructed yet?" If so, it should definitely be static. Java: when to use static methodsstackoverflow.com