日期:2014-05-20 浏览次数:20738 次
public static void saveResult(ResultSet set, String filePath) { PrintWriter out = null; try { out = new PrintWriter(filePath); while(set.next()) { // String xxx = set.getString(columnLabel); //TODO 自己写 // String yyy = set.getString(columnLabel); //TODO 自己写 // out.println(xxx + yyy); out.flush(); } } catch (IOException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } finally { if (out != null) { out.close(); out = null; } } }
------解决方案--------------------