class sample{public static int i ;static{
  i = ……  //访问数据库产生异常
}}
f(){
  int j = sample.i;    //希望这里能接收到异常
  ……
}