for sql connection we generally do like the following way
Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","username","password"); As this throws exception so we generally write inside try block.But my question if i write unnecessary codes that does not throws exception with in try block then will the performance gets effected?
try { //some 100 lines codes that does not throw exception Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","username","password"); } catch(Exception e) { }