package tools;
import java.sql.*;
public class DBError {
public static void out(SQLException e) {
if (e == null)
return;
e.printStackTrace();
System.out.println("SQLException ErrorCode" + e.getErrorCode());
SQLException nextException = e.getNextException();
out(nextException);
}
public static void out(SQLWarning w) {
if (w == null)
return;
w.printStackTrace();
System.out.println("SQLWarning ErrorCode" + w.getErrorCode());
SQLWarning nextWarning = w.getNextWarning();
out(nextWarning);
}
}
JDBC Error类
最新推荐文章于 2022-06-05 23:57:23 发布
本文介绍了一个Java类,用于处理SQL异常和警告,包括打印异常堆栈跟踪和输出错误代码。
277

被折叠的 条评论
为什么被折叠?



