Created
March 5, 2009 23:59
-
-
Save jeduan/74659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<TableroControlTO> obtenTableroColegio(int cveunidad, int subgrupo, String anio) { | |
List<TableroControlTO> unidades = new ArrayList<TableroControlTO>(); | |
Connection con = null; | |
try { | |
con = getDataSource().getConnection(); | |
PreparedStatement pstm = con.prepareStatement("SELECT * FROM sistema.tableroestatal(?, ?, ?)"); | |
pstm.setInt(1, cveunidad ); | |
pstm.setInt(2, subgrupo); | |
pstm.setString(3, anio); | |
ResultSet rs = pstm.executeQuery(); | |
while (rs.next()) { | |
TableroControlTO unidad = new TableroControlTO(); | |
unidad.descunidad = rs.getString("unidad"); | |
unidad.grupo = rs.getString("grupo"); | |
unidad.subgrupo = rs.getString("subgpo"); | |
unidad.periodicidad = rs.getString("periodicidad"); | |
unidad.factual = new Date(); | |
unidad.enero = rs.getString("enero"); | |
unidad.febrero = rs.getString("febrero"); | |
unidad.marzo = rs.getString("marzo"); | |
unidad.abril = rs.getString("abril"); | |
unidad.mayo = rs.getString("mayo"); | |
unidad.junio = rs.getString("junio"); | |
unidad.julio = rs.getString("julio"); | |
unidad.agosto = rs.getString("agosto"); | |
unidad.septiembre = rs.getString("septiembre"); | |
unidad.octubre = rs.getString("octubre"); | |
unidad.noviembre = rs.getString("noviembre"); | |
unidad.diciembre = rs.getString("diciembre"); | |
// unidad.enero = rs.getString("enero")); | |
// unidad.febrero = rs.getString("febrero")); | |
// unidad.marzo = rs.getString("marzo")); | |
// unidad.abril = rs.getString("abril")); | |
// unidad.mayo = rs.getString("mayo")); | |
// unidad.junio = rs.getString("junio")); | |
// unidad.julio = rs.getString("julio")); | |
// unidad.agosto = rs.getString("agosto")); | |
// unidad.septiembre = rs.getString("septiembre")); | |
// unidad.octubre = rs.getString("octubre")); | |
// unidad.noviembre = rs.getString("noviembre")); | |
// unidad.diciembre = rs.getString("diciembre")); | |
unidades.add(unidad); | |
} | |
} catch (Exception ex) { | |
Logger.getLogger(PeriodoFacade.class.getName()).log(Level.SEVERE, null, ex); | |
} finally { | |
try { | |
if (con != null) { | |
con.close(); | |
} | |
} catch (SQLException ex) { | |
Logger.getLogger(PeriodoFacade.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
} | |
return unidades; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment