public static int parseInt(String i, int defaultValue) { if (i == null || i.isEmpty()) { return defaultValue; } try { return (Integer.parseInt(i)); } catch(NumberFormatException nfe) { P6LogQuery.error("NumberFormatException occured parsing value "+i); return defaultValue; } }
private void loadDriversExplicitly(P6SpyLoadableOptions spyOptions) { final Collection<String> driverNames = spyOptions.getDriverNames(); if (null != driverNames) { for (String driverName : driverNames) { try { // you really only need to load the driver if it is not a // type 4 driver! P6Util.forName(driverName).newInstance(); } catch (Exception e) { String err = "Error registering driver names: " + driverNames + " \nCaused By: " + e.toString(); P6LogQuery.error(err); throw new P6DriverNotFoundError(err); } } } }
P6LogQuery.error(msg); if( LOG_FILE.exists() ) { final String logged = FileUtils.readFileToString(LOG_FILE, "UTF-8");
public static int parseInt(String i, int defaultValue) { if (i == null || i.isEmpty()) { return defaultValue; } try { return (Integer.parseInt(i)); } catch(NumberFormatException nfe) { P6LogQuery.error("NumberFormatException occured parsing value "+i); return defaultValue; } }
private void loadDriversExplicitly(P6SpyLoadableOptions spyOptions) { final Collection<String> driverNames = spyOptions.getDriverNames(); if (null != driverNames) { for (String driverName : driverNames) { try { // you really only need to load the driver if it is not a // type 4 driver! P6Util.forName(driverName).newInstance(); } catch (Exception e) { String err = "Error registering driver names: " + driverNames + " \nCaused By: " + e.toString(); P6LogQuery.error(err); throw new P6DriverNotFoundError(err); } } } }
private void loadDriversExplicitly(P6SpyLoadableOptions spyOptions) { final Collection<String> driverNames = spyOptions.getDriverNames(); if (null != driverNames) { for (String driverName : driverNames) { try { // you really only need to load the driver if it is not a // type 4 driver! P6Util.forName(driverName).newInstance(); } catch (Exception e) { String err = "Error registering driver names: " + driverNames + " \nCaused By: " + e.toString(); P6LogQuery.error(err); throw new P6DriverNotFoundError(err); } } } }