Public Member Functions | |
Query (Connection conn, PrintWriter pw) | |
Query (Connection conn, PrintWriter pw, String sql) | |
void | execute (String sql) |
void | query (String sql) |
void | printSql (String sql) |
void | close () |
Static Public Member Functions | |
static void | rethrow (Throwable e) |
Public Attributes | |
Statement | s |
ResultSet | r |
PrintWriter | pw |
Static Public Attributes | |
static final boolean | DEBUG = false |
Definition at line 12 of file Query.java.
|
Definition at line 20 of file Query.java. 00021 { 00022 this(conn, pw, null); 00023 }
|
|
Definition at line 25 of file Query.java. 00026 { 00027 this.pw = pw; 00028 try 00029 { 00030 s = conn.createStatement(); 00031 if (sql != null) query(sql); 00032 } 00033 catch(SQLException e) 00034 { 00035 Widget.ShowException(e, pw); 00036 } 00037 }
|
|
Definition at line 75 of file Query.java. 00076 { 00077 try 00078 { 00079 try 00080 { 00081 if (r != null) 00082 { 00083 r.close(); 00084 r = null; 00085 } 00086 } 00087 finally 00088 { 00089 s.close(); 00090 s = null; 00091 } 00092 } 00093 catch (SQLException e) 00094 { 00095 Widget.ShowException(e, pw); 00096 } 00097 }
|
|
Definition at line 39 of file Query.java. References DEBUG, printSql(), pw, and s. 00040 { 00041 if (DEBUG) printSql(sql); 00042 try 00043 { 00044 s.executeUpdate(sql); 00045 } 00046 catch (SQLException e) 00047 { 00048 pw.println("<h2>Failed to execute SQL Statement:</h2>"); 00049 printSql(sql); 00050 Widget.ShowException(e, pw); 00051 } 00052 }
|
|
Definition at line 70 of file Query.java. References pw. 00071 { 00072 pw.println("<pre style=\"background-color: #EEEEEE\">" + sql + "</pre>"); 00073 }
|
|
Definition at line 54 of file Query.java. References DEBUG, printSql(), pw, r, and s. 00055 { 00056 if (DEBUG) printSql(sql); 00057 try 00058 { 00059 if (r != null) r.close(); 00060 r = s.executeQuery(sql); 00061 } 00062 catch (SQLException e) 00063 { 00064 pw.println("<h2>Failed to execute SQL Query:</h2>"); 00065 printSql(sql); 00066 Widget.ShowException(e, pw); 00067 } 00068 }
|
|
Definition at line 99 of file Query.java. 00100 { 00101 if (e instanceof RuntimeException) 00102 throw (RuntimeException) e; 00103 if (e instanceof Error) 00104 throw (Error) e; 00105 else // should never happen 00106 throw new Error("Unknown Exception caught", e); 00107 }
|
|
Definition at line 18 of file Query.java. |
|
Definition at line 16 of file Query.java. |
|
Definition at line 15 of file Query.java. |
|
Definition at line 14 of file Query.java. |