/** * @param fileName The fileName to set. */ public void setFileName(String fileName) { this.fileName = fileName; setAppend(false); }
/** * Pass in some SQL. If print is set to true this will output to the * screen. If file is set to true, this will write to the file specified. * * @param sql SQL string * @throws BrowseException if browse error */ public void sql(String sql) throws BrowseException { if (isPrint()) { System.out.println(sql); } if (isFile()) { try { BufferedWriter out = new BufferedWriter(new FileWriter(fileName, isAppend())); out.write(sql + "\n"); out.close(); setAppend(true); } catch (IOException e) { throw new BrowseException(e); } } }
/** * Pass in a message to be processed. If the setting is verbose * then this will be output to System.out * * @param message the message to set */ public void message(String message) { if (isVerbose()) { System.out.println(message); } }