import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class SqliteTest { public static void main(String[] args) { Connection conn = null; try { Class.forName("org.sqlite.JDBC"); conn = DriverManager.getConnection("jdbc:sqlite:mydb.db"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("select * from aa"); while(rs.next()){ String id = rs.getString(1); System.out.println("用户名:" + id ); } rs.close(); stmt.close(); conn.close(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
最近下载更多
breakCY LV15
2021年2月26日
哈哈zr LV11
2020年5月5日
bypzuidaima LV2
2019年11月20日
XHacker LV9
2018年12月24日
ttttttttttttttt LV7
2018年11月24日
Cielo2018 LV3
2018年4月18日
lingluo75952 LV6
2016年12月26日
ljc520313 LV22
2016年2月14日
gbload LV1
2016年1月15日
文字青年 LV4
2015年11月30日