/** * Parses a given list of options. * <!-- options-start --> * Valid options are: * * <p> * * <pre> -Q <query> * SQL query to execute.</pre> * * <pre> -S * Return sparse rather than normal instances.</pre> * * <pre> -U <username> * The username to use for connecting.</pre> * * <pre> -P <password> * The password to use for connecting.</pre> * * <pre> -D * Enables debug output.</pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { String tmpStr; setSparseData(Utils.getFlag('S', options)); tmpStr = Utils.getOption('Q', options); if (tmpStr.length() != 0) setQuery(tmpStr); tmpStr = Utils.getOption('U', options); if (tmpStr.length() != 0) setUsername(tmpStr); tmpStr = Utils.getOption('P', options); if (tmpStr.length() != 0) setPassword(tmpStr); setDebug(Utils.getFlag('D', options)); }
/** * Parses a given list of options. * <!-- options-start --> * Valid options are: * * <p> * * <pre> -Q <query> * SQL query to execute.</pre> * * <pre> -S * Return sparse rather than normal instances.</pre> * * <pre> -U <username> * The username to use for connecting.</pre> * * <pre> -P <password> * The password to use for connecting.</pre> * * <pre> -D * Enables debug output.</pre> * * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { String tmpStr; setSparseData(Utils.getFlag('S', options)); tmpStr = Utils.getOption('Q', options); if (tmpStr.length() != 0) setQuery(tmpStr); tmpStr = Utils.getOption('U', options); if (tmpStr.length() != 0) setUsername(tmpStr); tmpStr = Utils.getOption('P', options); if (tmpStr.length() != 0) setPassword(tmpStr); tmpStr = Utils.getOption("custom-props", options); if (tmpStr.length() == 0) setCustomPropsFile(null); else setCustomPropsFile(new File(tmpStr)); setDebug(Utils.getFlag('D', options)); }