Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String desde1=txtDesde.getText();
- String hasta1=txtHasta.getText();
- Class.forName("com.mysql.jdbc.Driver");
- cn=(Connection) DriverManager.getConnection("jdbc:mysql://localhost/","root","");
- ps=(PreparedStatement) cn.prepareStatement("select Item,Fecha,N_acta,Descripcion,"
- + "Cantidad,Tipo_moneda,Condicion,Ape_pa,Ape_ma,"
- + "Nombres,Nacionalidad,Tipo_doc,Dni,Direccion,Distrito,Provincia,Departamento,Jefe_sala,"
- + "Modalidad from premio1"+ " WHERE N_acta BETWEEN'"+desde1+"'AND'"+hasta1+"'");
- rs=ps.executeQuery();
- rsm=(ResultSetMetaData) rs.getMetaData();
- ArrayList<Object[]>data=new ArrayList<>();
- while(rs.next()){
- Object[] rows=new Object[rsm.getColumnCount()];
- for(int i = 0; i < rows.length; i++ ){
- rows[i]=rs.getObject(i+1);
- }
- data.add(rows);
- }
- dtm=(DefaultTableModel)this.jReportePremio.getModel();
- for(int i=0; i<data.size();i++){
- dtm.addRow(data.get(i));
- }
Add Comment
Please, Sign In to add comment