public static ResultSet select(String column, String tableName, String whereSintax) {
ResultSet rs;
if (!isActive()) {
DataBase.createConnection();
}
if (isActive()) {
String command = "SELECT " + column + " FROM " + tableName + " WHERE ";
command += whereSintax;
System.out.println("_[>>] Select process...");
System.out.println(command);
try {
//rs = stmt.executeQuery(command); // -> OLD WAY
conn.prepare(command); // with sqlite4java
// ???????
} catch (SQLiteException ex) {
Logger.getLogger(DataBase.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
System.out.println("_[OK] done!.");
} else {
System.err.println("_[ERRO] Database is missing;.");
return null;
}
return rs;
}
[/code]