Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Created July 2, 2011 01:59
Show Gist options
  • Save pokutuna/1059672 to your computer and use it in GitHub Desktop.
Save pokutuna/1059672 to your computer and use it in GitHub Desktop.
import java.sql.*;
public class SQLiteSample {
public static void main(String[] args) {
try {
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite:sensing.db");
Statement stat = conn.createStatement();
ResultSet rs = stat.executeQuery("select * from bt_detected where address like 'A%'");
while (rs.next()) {
System.out.println("address = " + rs.getString("address"));
}
rs.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment