Skip to content

Instantly share code, notes, and snippets.

@up1
Last active August 29, 2015 14:05
Show Gist options
  • Save up1/17baf2a263f40623e7f4 to your computer and use it in GitHub Desktop.
Save up1/17baf2a263f40623e7f4 to your computer and use it in GitHub Desktop.
Java :: Check vs Uncheck Exception
public void insert() throws Exception{
try {
preparedStatement = connection.createPreparedStatement(sql);
preparedStatement.executeQuery();
}catch(SQLException exception) {
throw new Exception( exception );
}
}
public void insert() {
try {
preparedStatement = connection.createPreparedStatement(sql);
preparedStatement.executeQuery();
}catch(SQLException exception) {
throw new InsertException( exception );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment