I got this error while trying to compile the below code. I would like to know what is I have done wrong.
unreported exception java.sql.SQLException; must be caugh
This line of code throws an uncaught exception:
Driver driver = new org.gjt.mm.mysql.Driver();
try this:
try { Driver driver = new org.gjt.mm.mysql.Driver(); } catch (java.sql.SQLException e) { // you may want to do something useful here // maybe even throw new RuntimException(); }