I'm trying to make a connection to MySQL database, but when I use PreparedStatement
, eclipse returns: Definir projeto de construção JRE entrada caminho para 'JavaSE-1.7
Yes, I've changed the compiler version to 1.7, but only works with Android 1.5 and 1.6 right? How can I connect to my database? This is my real method for connecting:
private ArrayList<String> sql = new ArrayList<String>();
private Connection con;
public String getUsuario(String...parametros) throws SQLException {
sql.add("SELECT "+parametros[1]+"FROM users WHERE 'usuario_id' = "+parametros[0]+";");
for (String string : sql) {
try (PreparedStatement stm = con.prepareStatement(string);
ResultSet rs = stm.executeQuery()) {
while(rs.next()) {
System.out.println(rs.getString("usuario_senha"));
}
}
}
return "";
}