关于数据库的问题
我在程序里加入Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");之后,编译提示错误:unreported exception java.lang.ClassNotFoundException;must be caught or declare to be thrown .
而把那句话放到如下try中,编译通过,没有任何错误信息。
try{......}
catch(java.lang.ClassNotFoundException e)
{
System.out.println("ClassNotFoundException:");
System.out.println(e.getMessage());
}
请问各位错误在哪里?谢谢指教!