Java?????????о??????
???????????? ???????[ 2016/3/23 10:59:55 ] ??????????????????? ???????
????????????????????????????????????????????con??null????????finally??????????NullPointerException????finally?????????con????null???ж???????????????????
???????????
??????????????
public void method2()
{
try
{
……
method1(); //method1??????????????
}
catch(SQLException e)
{
……
throw new MyException("?????????????:"+e.getMessage);
}
}
public void method3()
{
try
{
method2();
}
catch(MyException e)
{
e.printStackTrace();
……
}
}
????????method2??????У?try?鯰??method1????????????SQLException????????μ????????MyException????δ?????????????????????????????????
????MyException:???????????????????????'MyTable' ??Ч??
????at MyClass.method2(MyClass.java:232)
????at MyClass.method3(MyClass.java:255)
????????SQLException?????????????????????method2???漲???MyException???????????method1?з??????????????????????????????????????method1????????????????????????????????
????JDK???????????????????????????JDK1.4.1?У?Throwable????????????????????public Throwable(Throwable cause)??public Throwable(String message??Throwable cause)??????????д????????????????????printStackTrace?????д????????????????????JDK1.3????????????????????????????????????????????????????????????????????????????????Σ?????????д????????????????printStackTrace????????????????б??????????printStackTrace??????????????super.printStackTrace?????????????????????????????????????????г????MyException??
import java.io.PrintStream;
import java.io.PrintWriter;
public class MyException extends Exception
{
private static final long serialVersionUID = 1L;
//????
private Throwable cause;
//??????
public MyException(Throwable cause)
{
this.cause = cause;
}
public MyException(String s??Throwable cause)
{
super(s);
this.cause = cause;
}
//????printStackTrace?????????????????????
public void printStackTrace()
{
if (cause != null)
{
cause.printStackTrace();
}
super.printStackTrace();
}
public void printStackTrace(PrintStream s)
{
if (cause != null)
{
cause.printStackTrace(s);
}
super.printStackTrace(s);
}
public void printStackTrace(PrintWriter s)
{
if (cause != null)
{
cause.printStackTrace(s);
}
super.printStackTrace(s);
}
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????