NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
GuzmanDiaz18
Joined: 22 Apr 2011 Posts: 3
|
Posted: Fri Dec 02, 2011 12:12 pm Post subject: Problem 2 Tables |
|
|
Hello Community;
I have a problem for a couple of hours does not resolve, is the following.
I have a Table A and Table B, Table A is filled with a ResultSet and Table B is being added to products available in Table A, the idea is simple, once you click on the Add button passes the product of Table A to Table B, and the last product is no longer displayed in Table A. I've tried to do.
private void Redibujar() {
ResultSet Resultado;
MySQL ClaseMySQL = new MySQL();
ClaseMySQL.EstablecerConexion();
try {
Resultado = ClaseMySQL.Consulta("SELECT p.productoID,p.nombre,p.numeroexisten,p.costoventa FROM vista_productos p");
while (Resultado.next()) {
for (int i = 0; i < jtblDetalleBoleta.getRowCount(); i++) {
if (Integer.parseInt(String.valueOf(jtblDetalleBoleta.getValueAt(i, 0))) != Resultado.getInt(1)) {
Object Datos[] = new Object[4];
for (int j = 0; j < Datos.length; j++) {
Datos[j] = Resultado.getObject(j + 1);
}
modelojtblBusquedaRapida.addRow(Datos);
}
}
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, ex);
}
} |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|