Skip to content
Snippets Groups Projects
Commit 57fb0871 authored by Goik Martin's avatar Goik Martin
Browse files

Unthrown Exception in main()

parent 0cd771a7
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ public class SimpleInsert {
static private final Logger log = LogManager.getLogger (SimpleInsert.class);
static public final ResourceBundle jdbcProperties = ResourceBundle.getBundle("jdbc");
static final ResourceBundle jdbcProperties = ResourceBundle.getBundle("jdbc");
/**
* <p>Disclaimer:</p>
......@@ -48,16 +48,14 @@ public class SimpleInsert {
* <li>... something forgotten to think about?</li>
* </ul>
*/
public static void main(String[] args) {
public static void main(String[] args) throws SQLException {
try (final Connection conn = DriverManager.getConnection(
final Connection conn = DriverManager.getConnection(
jdbcProperties.getString("jdbcurl"),
jdbcProperties.getString("username"),
jdbcProperties.getString("password"))) {
jdbcProperties.getString("password"));
handleUserInput(conn.createStatement());
} catch (final SQLException e) {
log.error("General database connection problem:", e);
}
conn.close();
}
static private void handleUserInput(final Statement statement) throws SQLException {
try (final Scanner scanner = new Scanner(System.in)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment