package com.duplicall.export.dao; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import com.duplicall.export.util.JdbcUtils; public class SelectUsers { public static void run(String path) { try { Connection conn = JdbcUtils.getConnection(); conn.setAutoCommit(false); Statement stmt = conn.createStatement(); String sql1 = "select * from users"; ResultSet rs = stmt.executeQuery(sql1); FileOutputStream fos1 = null; try { fos1 = new FileOutputStream(path, true); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { PrintStream p1 = new PrintStream(fos1); while (rs.next()) { String sb = rs.getInt(1) + "," + rs.getString(2) + "," + rs.getString(3) + "," + rs.getString(4) + "," + rs.getInt(5) + rs.getString(6) + "," + rs.getString(7) + "," + rs.getInt(8) + "," + rs.getTimestamp(9); p1.println(sb); } p1.close(); try { if (fos1 != null) { System.out.println("------ceshi"); fos1.close(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }

1358849392 LV21
2023年7月1日
zzuljh LV9
2021年12月16日
qiheideguang LV18
2019年9月11日
woshigsb LV5
2018年9月7日
一个友好的小朋友 LV18
2017年4月4日
a3870764722a LV22
2017年1月3日
aihui523 LV34
2016年12月29日
最代码官方 LV168
2016年12月29日

刘孟飞 LV22
2024年6月21日
1358849392 LV21
2022年11月10日
qwqw900619 LV4
2022年7月16日
1265260263 LV4
2022年4月8日
zzuljh LV9
2021年12月16日
itcaizhe LV9
2021年7月26日
zyzyzy1 LV1
2021年4月30日
329512801 LV28
2021年4月8日
ma406805131 LV19
2021年3月11日
sun丶孙 LV8
2020年11月6日