NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Problem 2 Tables

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
GuzmanDiaz18



Joined: 22 Apr 2011
Posts: 3

PostPosted: Fri Dec 02, 2011 12:12 pm    Post subject: Problem 2 Tables Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo