File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,8 @@ public void readingAResultSet() throws SQLException {
108
108
}
109
109
110
110
// closing a Database
111
+ /**
112
+ *
111
113
public void closingDataBase() throws SQLException {
112
114
String url = " jdbc:derby:zoo";
113
115
try (Connection conn = (Connection) DriverManager.getConnection(url);
@@ -117,6 +119,7 @@ public void closingDataBase() throws SQLException {
117
119
System.out.println(rs.getString(1));
118
120
}
119
121
}
122
+ */
120
123
121
124
// closing a Database prior to Java 7
122
125
public void closingDataBase1 () throws SQLException {
@@ -135,7 +138,7 @@ public void closingDataBase1() throws SQLException {
135
138
{
136
139
closeResultSet (rs );
137
140
closeStatement (stmt );
138
- closeConnection (conn );
141
+ // closeConnection(conn);
139
142
}
140
143
}
141
144
@@ -155,14 +158,17 @@ private void closeStatement(Statement stmt) {
155
158
}
156
159
}
157
160
161
+ /**
158
162
private void closeConnection(Connection conn) {
159
163
try {
160
164
if (conn != null)
161
165
conn.close();
162
166
} catch (SQLException e) {
163
167
}
164
168
}
169
+ */
165
170
171
+ /**
166
172
public void dealingWithExceptions() {
167
173
String url = " jdbc:derby:zoo";
168
174
try (Connection conn = DriverManager.getConnection(url);
@@ -176,4 +182,5 @@ public void dealingWithExceptions() {
176
182
System.out.println(e.getErrorCode());
177
183
}
178
184
}
185
+ */
179
186
}
You can’t perform that action at this time.
0 commit comments