Commit 407c0dd7 by GongDaCheng

异常处理

parent e7f00dea
...@@ -24,7 +24,7 @@ public class SqliteDb { ...@@ -24,7 +24,7 @@ public class SqliteDb {
try { try {
f.createNewFile(); f.createNewFile();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} }
} }
Connection conn; Connection conn;
...@@ -144,7 +144,7 @@ public class SqliteDb { ...@@ -144,7 +144,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -171,7 +171,7 @@ public class SqliteDb { ...@@ -171,7 +171,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -196,7 +196,7 @@ public class SqliteDb { ...@@ -196,7 +196,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -229,7 +229,7 @@ public class SqliteDb { ...@@ -229,7 +229,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -259,7 +259,7 @@ public class SqliteDb { ...@@ -259,7 +259,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -289,7 +289,7 @@ public class SqliteDb { ...@@ -289,7 +289,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -333,7 +333,7 @@ public class SqliteDb { ...@@ -333,7 +333,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -367,7 +367,7 @@ public class SqliteDb { ...@@ -367,7 +367,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -416,7 +416,7 @@ public class SqliteDb { ...@@ -416,7 +416,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -460,7 +460,7 @@ public class SqliteDb { ...@@ -460,7 +460,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -494,7 +494,7 @@ public class SqliteDb { ...@@ -494,7 +494,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -528,7 +528,7 @@ public class SqliteDb { ...@@ -528,7 +528,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -582,7 +582,7 @@ public class SqliteDb { ...@@ -582,7 +582,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -629,7 +629,7 @@ public class SqliteDb { ...@@ -629,7 +629,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -660,7 +660,7 @@ public class SqliteDb { ...@@ -660,7 +660,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -695,7 +695,7 @@ public class SqliteDb { ...@@ -695,7 +695,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -734,7 +734,7 @@ public class SqliteDb { ...@@ -734,7 +734,7 @@ public class SqliteDb {
phase = "c"; phase = "c";
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -766,7 +766,7 @@ public class SqliteDb { ...@@ -766,7 +766,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -796,7 +796,7 @@ public class SqliteDb { ...@@ -796,7 +796,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -830,7 +830,7 @@ public class SqliteDb { ...@@ -830,7 +830,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -866,7 +866,7 @@ public class SqliteDb { ...@@ -866,7 +866,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -904,7 +904,7 @@ public class SqliteDb { ...@@ -904,7 +904,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -934,7 +934,7 @@ public class SqliteDb { ...@@ -934,7 +934,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -968,7 +968,7 @@ public class SqliteDb { ...@@ -968,7 +968,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1002,7 +1002,7 @@ public class SqliteDb { ...@@ -1002,7 +1002,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
if (rs != null) { if (rs != null) {
...@@ -1044,7 +1044,7 @@ public class SqliteDb { ...@@ -1044,7 +1044,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1075,7 +1075,7 @@ public class SqliteDb { ...@@ -1075,7 +1075,7 @@ public class SqliteDb {
count = rs.getInt(1); count = rs.getInt(1);
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1118,7 +1118,7 @@ public class SqliteDb { ...@@ -1118,7 +1118,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1158,7 +1158,7 @@ public class SqliteDb { ...@@ -1158,7 +1158,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1188,7 +1188,7 @@ public class SqliteDb { ...@@ -1188,7 +1188,7 @@ public class SqliteDb {
count = rs.getInt(1); count = rs.getInt(1);
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1233,7 +1233,7 @@ public class SqliteDb { ...@@ -1233,7 +1233,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1277,7 +1277,7 @@ public class SqliteDb { ...@@ -1277,7 +1277,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1316,7 +1316,7 @@ public class SqliteDb { ...@@ -1316,7 +1316,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1359,7 +1359,7 @@ public class SqliteDb { ...@@ -1359,7 +1359,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1391,7 +1391,7 @@ public class SqliteDb { ...@@ -1391,7 +1391,7 @@ public class SqliteDb {
count = rs.getInt(1); count = rs.getInt(1);
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1435,7 +1435,7 @@ public class SqliteDb { ...@@ -1435,7 +1435,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1466,7 +1466,7 @@ public class SqliteDb { ...@@ -1466,7 +1466,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1519,7 +1519,7 @@ public class SqliteDb { ...@@ -1519,7 +1519,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1573,7 +1573,7 @@ public class SqliteDb { ...@@ -1573,7 +1573,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1603,7 +1603,7 @@ public class SqliteDb { ...@@ -1603,7 +1603,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1636,7 +1636,7 @@ public class SqliteDb { ...@@ -1636,7 +1636,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1666,7 +1666,7 @@ public class SqliteDb { ...@@ -1666,7 +1666,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
...@@ -1697,7 +1697,7 @@ public class SqliteDb { ...@@ -1697,7 +1697,7 @@ public class SqliteDb {
} }
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace(); throw new RuntimeException(e.getMessage());
} finally { } finally {
try { try {
rs.close(); rs.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论