All,
I'd like to keep attempting my jdbc work if there is a deadlock or any exception.
Here is my code:
boolean working = true;
while(working){
try {
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, user, password);
Statement st = conn.createStatement();
x = st.executeUpdate(query);
st.close();
conn.close();
}catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
working = false;
}
return x;
Is this a good or bad way of restarting my jdbc work?