Skip to content

Instantly share code, notes, and snippets.

@Horaddrim
Created August 11, 2017 19:12
Show Gist options
  • Save Horaddrim/825747b4a11c20f536d796b1eaa04744 to your computer and use it in GitHub Desktop.
Save Horaddrim/825747b4a11c20f536d796b1eaa04744 to your computer and use it in GitHub Desktop.
:D
public static ArrayList<Patio> getArrayListPatios()
{
try
{
Connection con = ConnectionFactory.getConnection();
//
// Cria e executa o comando SQL.
//
String SQL = "EXEC SPVERITHUS_RetornaPatios 0, '','A' "; // EXECUTA A SP PEGANDO PARAMETROS
Statement PS = con.createStatement();
ResultSet rs = PS.executeQuery(SQL);
ArrayList<Patio> Patio = new ArrayList<Patio>();
while(rs.next())
{
Patio patioAchado = new Patio(rs.getInt("IdPatio"),rs.getString("NomPatio"),rs.getString("IndExclusao"));
Patio.add(patioAchado);
}
System.out.println(Patio.get(0).getIdPatio() + Patio.get(0).getNomePatio());
return Patio;
}
catch(Exception Ex)
{
Ex.printStackTrace();
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment