请教:关于几种异常处理方式的疑惑?
以下的几种用法我有点混乱,能告诉我一下他们的区别吗?
A.public void getConn(String url,String name,String pwd){
try{
...
}
catch(SQLException sqle){
...
}
}
B.public void getConn(String url,String name,String pwd) throws SQLException
{
...// 没有try-catch-finally语句块
}
C.public void getConn(String url,String name,String pwd) throws SQLException{
try{
...
}
catch(SQLExecption sqle){
...
}
}
D.public void getConn(String url,String name,String pwd) throws SQLException{
try{
...
}
cath(SQLException sqle1){
...
throw sqle1
}
}