没有扑获异常。。
     Class.forName()载入一个类,参数是类名。如果没找到类则抛出异常,try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException e){
    System.err.println(e);
}

解决方案 »

  1.   

    class TestDb 
    {
    public static void main(String[] args) 
    {
                   try
                   {
                         System.out.println("hello");    
                         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   }
                   catch(Exception e)
                   {
                         System.out.println(e);
                   }
            }
    }把程序改成上面的样子了,JAVA在编译时有要求,必须捕获异常.....